Author: kotkov Date: Wed Aug 9 15:25:32 2017 New Revision: 1804543 URL: http://svn.apache.org/viewvc?rev=1804543&view=rev Log: On the '1.3.x-fix-outgoing-request-err' branch: Unset the hit_eof flag before reading from the pending output buckets.
With the current approach where a hold_open aggregate bucket is used to check for the end of the outgoing data, the "hit_eof" flag can also be inadvertently set when peeking at this bucket request_or_data_pending(). That would cause the actual read error (read_status) to be silently ignored if the flag is has been set before the call to read_iovec(). Note: in trunk, the new serf_pump__write() function does the same thing. * outgoing.c (write_to_connection): Unset the hit_eof flag before calling read_iovec(). Modified: serf/branches/1.3.x-fix-outgoing-request-err/outgoing.c Modified: serf/branches/1.3.x-fix-outgoing-request-err/outgoing.c URL: http://svn.apache.org/viewvc/serf/branches/1.3.x-fix-outgoing-request-err/outgoing.c?rev=1804543&r1=1804542&r2=1804543&view=diff ============================================================================== --- serf/branches/1.3.x-fix-outgoing-request-err/outgoing.c (original) +++ serf/branches/1.3.x-fix-outgoing-request-err/outgoing.c Wed Aug 9 15:25:32 2017 @@ -815,6 +815,7 @@ static apr_status_t write_to_connection( data as available, we probably don't want to read ALL_AVAIL, but a lower number, like the size of one or a few TCP packets, the available TCP buffer size ... */ + conn->hit_eof = 0; read_status = serf_bucket_read_iovec(ostreamh, SERF_READ_ALL_AVAIL, IOV_MAX,