]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
request: clear sendbuf_hds_len when resetting request bufq
authorOndřej Hlavatý <aearsis@eideo.cz>
Wed, 5 Mar 2025 13:09:26 +0000 (14:09 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 5 Mar 2025 13:54:33 +0000 (14:54 +0100)
Without this, any usage of sendbuf_hds_len on a retried request is
wrong. We noticed by getting debug callbacks with incorrect header len.
We did not figure out how to trigger the retries in a test environment
though.

Closes #16573

lib/request.c

index 667880fa76fb49abae9363e8b9acb1da29296c40..04b8348f6b5ac8a60e2abd47807a05784f968d90 100644 (file)
@@ -69,6 +69,8 @@ CURLcode Curl_req_soft_reset(struct SingleRequest *req,
   req->deductheadercount = 0;
   req->httpversion_sent = 0;
   req->httpversion = 0;
+  req->sendbuf_hds_len = 0;
+
   result = Curl_client_start(data);
   if(result)
     return result;
@@ -141,6 +143,7 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data)
   req->httpcode = 0;
   req->keepon = 0;
   req->upgr101 = UPGR101_INIT;
+  req->sendbuf_hds_len = 0;
   req->timeofdoc = 0;
   req->location = NULL;
   req->newurl = NULL;