http: revisit http_perhapsrewind()

- use facilities provided by client readers better
- work also for non-uploading requests like GET/HEAD
- update documentation

Closes #13117
This commit is contained in:
Stefan Eissing 2024-03-13 11:42:17 +01:00 committed by Daniel Stenberg
parent 6ea75877fa
commit 77b0571cdc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 73 additions and 96 deletions

View file

@ -237,6 +237,8 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf,
http_minor = (cf->conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0) ? 0 : 1;
result = Curl_h1_req_write_head(req, http_minor, &ts->request_data);
if(!result)
result = Curl_creader_set_null(data);
out:
if(result)
@ -749,6 +751,10 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf,
if(result)
goto error;
result = Curl_creader_set_null(data);
if(result)
goto error;
sendtask = hyper_clientconn_send(client, req);
if(!sendtask) {
failf(data, "hyper_clientconn_send");