Author: rhuijben Date: Thu Nov 26 14:50:54 2015 New Revision: 1716711 URL: http://svn.apache.org/viewvc?rev=1716711&view=rev Log: Make the http/1.1 request reading code properly changing the current request from outside the loop. This feature will be used to tweak the auth handling to re-use the existing request.
* outgoing.c (read_from_connection): Load request in the loop. Modified: serf/trunk/outgoing.c Modified: serf/trunk/outgoing.c URL: http://svn.apache.org/viewvc/serf/trunk/outgoing.c?rev=1716711&r1=1716710&r2=1716711&view=diff ============================================================================== --- serf/trunk/outgoing.c (original) +++ serf/trunk/outgoing.c Thu Nov 26 14:50:54 2015 @@ -796,15 +796,6 @@ static apr_status_t read_from_connection apr_pool_t *tmppool; apr_status_t close_connection = APR_SUCCESS; - /* Whatever is coming in on the socket corresponds to the first request - * on our chain. - */ - serf_request_t *request = conn->written_reqs; - if (!request) { - /* Request wasn't completely written yet! */ - request = conn->unwritten_reqs; - } - /* If the stop_writing flag was set on the connection, reset it now because there is some data to read. */ if (conn->pump.stop_writing) { @@ -819,8 +810,18 @@ static apr_status_t read_from_connection /* Invoke response handlers until we have no more work. */ while (1) { + serf_request_t *request; apr_pool_clear(tmppool); + /* Whatever is coming in on the socket corresponds to the first request + * on our chain. + */ + request = conn->written_reqs; + if (!request) { + /* Request wasn't completely written yet! */ + request = conn->unwritten_reqs; + } + /* We have a different codepath when we can have async responses. */ if (conn->async_responses) { /* TODO What about socket errors? */