http: move headers collecting to writer

- add a client writer that does "push" response
  headers written to the client if the headers api
  is enabled
- remove special handling in sendf.c
- needs to be installed very early on connection
  setup to catch CONNECT response headers

Closes #12880
This commit is contained in:
Stefan Eissing 2024-02-06 13:55:07 +01:00 committed by Daniel Stenberg
parent 5b41fac587
commit 2abfa3833b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 90 additions and 19 deletions

View file

@ -3848,6 +3848,9 @@ CURLcode Curl_setup_conn(struct Curl_easy *data,
if(!conn->bits.reuse)
result = Curl_conn_setup(data, conn, FIRSTSOCKET, conn->dns_entry,
CURL_CF_SSL_DEFAULT);
if(!result)
result = Curl_headers_init(data);
/* not sure we need this flag to be passed around any more */
*protocol_done = FALSE;
return result;