summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/request.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2025-04-21 09:33:29 +0300
committerdartraiden <wowemuh@gmail.com>2025-04-21 09:50:38 +0300
commitcf6ba06cd445f1f4554701637d5bab581acfba98 (patch)
tree0d9b618df1c8f888cb37221be0590f4a677fe477 /libs/libcurl/src/request.c
parent842ec200cd37ae05f2a9c56f2a4040088d2ac917 (diff)
libcurl: update to 8.13.0
Diffstat (limited to 'libs/libcurl/src/request.c')
-rw-r--r--libs/libcurl/src/request.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/libs/libcurl/src/request.c b/libs/libcurl/src/request.c
index a4fa833e93..2a6239eb41 100644
--- a/libs/libcurl/src/request.c
+++ b/libs/libcurl/src/request.c
@@ -34,6 +34,7 @@
#include "sendf.h"
#include "transfer.h"
#include "url.h"
+#include "strparse.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -68,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;
@@ -140,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;
@@ -194,11 +198,13 @@ static CURLcode xfer_send(struct Curl_easy *data,
/* Allow debug builds to override this logic to force short initial
sends */
size_t body_len = blen - hds_len;
- char *p = getenv("CURL_SMALLREQSEND");
- if(p) {
- size_t body_small = (size_t)strtoul(p, NULL, 10);
- if(body_small && body_small < body_len)
- blen = hds_len + body_small;
+ if(body_len) {
+ const char *p = getenv("CURL_SMALLREQSEND");
+ if(p) {
+ curl_off_t body_small;
+ if(!Curl_str_number(&p, &body_small, body_len))
+ blen = hds_len + (size_t)body_small;
+ }
}
}
#endif
@@ -222,11 +228,11 @@ static CURLcode xfer_send(struct Curl_easy *data,
data->req.eos_sent = TRUE;
if(*pnwritten) {
if(hds_len)
- Curl_debug(data, CURLINFO_HEADER_OUT, (char *)buf,
+ Curl_debug(data, CURLINFO_HEADER_OUT, buf,
CURLMIN(hds_len, *pnwritten));
if(*pnwritten > hds_len) {
size_t body_len = *pnwritten - hds_len;
- Curl_debug(data, CURLINFO_DATA_OUT, (char *)buf + hds_len, body_len);
+ Curl_debug(data, CURLINFO_DATA_OUT, buf + hds_len, body_len);
data->req.writebytecount += body_len;
Curl_pgrsSetUploadCounter(data, data->req.writebytecount);
}