Author: kotkov Date: Wed Aug 9 15:41:07 2017 New Revision: 1804553 URL: http://svn.apache.org/viewvc?rev=1804553&view=rev Log: On the '1.3.x-fix-outgoing-request-err' branch: Tweak the error handling code when reading the data to write to the connection so that it would immediately propagate all real errors.
With r1804543 in place, such errors should be propagated anyway, as a "real error" would prevent the detect_eof() from being called, but this change should make the code a bit more future-proof. Note: in trunk, the new serf_pump__write() function does the same thing. * outgoing.c (write_to_connection): Unconditionally return real errors from serf_bucket_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=1804553&r1=1804552&r2=1804553&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:41:07 2017 @@ -821,6 +821,8 @@ static apr_status_t write_to_connection( IOV_MAX, conn->vec, &conn->vec_len); + if (SERF_BUCKET_READ_ERROR(read_status)) + return read_status; if (!conn->hit_eof) { if (APR_STATUS_IS_EAGAIN(read_status)) { @@ -842,9 +844,8 @@ static apr_status_t write_to_connection( conn->dirty_conn = 1; conn->ctx->dirty_pollset = 1; } - else if (read_status && !APR_STATUS_IS_EOF(read_status)) { - /* Something bad happened. Propagate any errors. */ - return read_status; + else if (APR_STATUS_IS_EOF(read_status)) { + /* Continue. */ } }