/[Apache-SVN]
ViewVC logotype

Revision 1716726


Jump to revision: Previous Next
Author: rhuijben
Date: Thu Nov 26 15:55:10 2015 UTC (8 years, 7 months ago)
Changed paths: 4
Log Message:
Make the auth code requeue the same request instance when another request is
needed to get the required response.

Serf 1.3 requeued a different request and destroyed the existing one, which
makes it impossible for end-user applications to perform further operations
on a request. This patch fixes that behavior by rerouting the existing
response to a new request instead.

* auth/auth.c
  (serf__handle_auth_response): Use bool. Just handle the headers and let
    requeue the request. This avoids work in case we can just reset the
    stream. Mark handling done to avoid processing every time during body
    handling.

* outgoing_request.c
  (clean_resp): Add comment.
  (serf__handle_response): Update caller.
  (create_request): Use bool arguments.
  (serf_connection_request_create): Update caller.
  (insert_priority_request): New function, extracted from...
  (priority_request_create): ... here.
  (discard_response_handler): New function.
  (serf__request_requeue): Rewrite as...
  (serf_connection__request_requeue): ... this.

* protocols/http2_stream.c
  (serf_http2_stream_data_t): Track resetted.
  (serf_http2__stream_create): Init value.
  (serf_http2__stream_reset): We reset only once.
  (serf_http2__stream_cancel_request): Handle request updating and
    the remaining work as reset.
  (stream_response_eof): Don't return EOF on stream reset, as handlers
    will commonly report that as reading errors. Just keep returning
    EAGAIN.
  (serf_http2__stream_processor): Handle switching requests and
    resetting requests.

* serf_private.h
  (IOV_MAX): Remove unused variable.
  (SERF__STD_IOV_COUNT): Use APR_MAX_IOVEC_SIZE instead of IOV_MAX.
  (serf_request_t): Add variable. Use bool for a few others.
  (serf__handle_auth_response): Use bool for output argument.

  (serf__request_requeue): Remove function.
  (serf_connection__request_requeue): New function.


Changed paths

Path Details
Directoryserf/trunk/auth/auth.c modified , text changed
Directoryserf/trunk/outgoing_request.c modified , text changed
Directoryserf/trunk/protocols/http2_stream.c modified , text changed
Directoryserf/trunk/serf_private.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26