Allow a response to handle multiple sets of headers for a single request.
This enables support for http statee like 100 'Continue'.

This also adds the foundation for enabling an improved auth request handling,
where in the future 401 and 407 responses will be handled on the request
itself by doing some bucket tricks below the response, to avoid destroying
and rescheduling requests.

At the http protocol layers there will still be rescheduled requests (of
course), but only a single response (attached via a serf_request_t) and
its handlers will handle all responses of the request, as if it is a single
response.

Once this system works, the same system can easily handle the 101 'Upgrade'
status for http/1.1 -> h2c as well.

And then one serf_request_t can be used to refer to a request in the entire
pipeline

* buckets/response_buckets.c
  (response_context_t): Hold two sets of headers.
  (serf_bucket_response_create): Tweak init.
  (serf_bucket_response_get_headers): Get the fetch headers.
  (serf_response_destroy_and_data): Update cleanup.
  (parse_status_line): Allow parsing another statusline.
  (fetch_headers): Store new headers in incoming headers.
  (run_machine): Handle new states.

  (serf_bucket_response_wait_for_some_headers): New function.
  (serf_response_full_become_aggregate): Update usage.

* serf_bucket_types.h
  (serf_bucket_response_wait_for_some_headers): New function.

* test/test_buckets.c
  (test_response_no_body_expected): Tweak expectations.
  (test_response_continue): New function.


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1715431 13f79535-47bb-0310-9956-ffa450edef68
3 files changed