[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 290/411: http: pass correct header size to debug callback for ch
From: |
gnunet |
Subject: |
[gnurl] 290/411: http: pass correct header size to debug callback for chunked post |
Date: |
Wed, 13 Jan 2021 01:21:45 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 584ccb5ef2488d589bc7589aef70227a98b080a2
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Fri Oct 30 11:29:22 2020 +0100
http: pass correct header size to debug callback for chunked post
... when the chunked framing was added, the size of the "body part" of
the data was calculated wrongly so the debug callback would get told a
header chunk a few bytes too big that would also contain the first few
bytes of the request body.
Reported-by: Dirk Wetter
Ref: #6144
Closes #6147
---
lib/http.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index a5f42eb97..d775c0b39 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2873,20 +2873,24 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
else {
if(postsize) {
+ char chunk[16];
/* Append the POST data chunky-style */
- result = Curl_dyn_addf(&req, "%x\r\n", (int)postsize);
+ msnprintf(chunk, sizeof(chunk), "%x\r\n", (int)postsize);
+ result = Curl_dyn_add(&req, chunk);
if(!result) {
+ included_body = postsize + strlen(chunk);
result = Curl_dyn_addn(&req, data->set.postfields,
(size_t)postsize);
if(!result)
result = Curl_dyn_add(&req, "\r\n");
- included_body = postsize + 2;
+ included_body += 2;
}
}
- if(!result)
+ if(!result) {
result = Curl_dyn_add(&req, "\x30\x0d\x0a\x0d\x0a");
- /* 0 CR LF CR LF */
- included_body += 5;
+ /* 0 CR LF CR LF */
+ included_body += 5;
+ }
}
if(result)
return result;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 321/411: test493: verify --hsts upgrade and that %{url_effective} reflects that, (continued)
- [gnurl] 321/411: test493: verify --hsts upgrade and that %{url_effective} reflects that, gnunet, 2021/01/12
- [gnurl] 314/411: docs: Fix various typos in documentation, gnunet, 2021/01/12
- [gnurl] 364/411: http3: use the master branch of GnuTLS for testing, gnunet, 2021/01/12
- [gnurl] 349/411: KNOWN_BUGS: cmake libcurl.pc uses absolute library paths, gnunet, 2021/01/12
- [gnurl] 278/411: CURLOPT_DNS_USE_GLOBAL_CACHE.3: fix typo, gnunet, 2021/01/12
- [gnurl] 329/411: Revert "libcurl.pc: make it relocatable", gnunet, 2021/01/12
- [gnurl] 327/411: Curl_pgrsStartNow: init speed limit time stamps at start, gnunet, 2021/01/12
- [gnurl] 310/411: KNOWN_BUGS: FTPS with Schannel times out file list operation, gnunet, 2021/01/12
- [gnurl] 295/411: travis: use valgrind when running tests for debug builds, gnunet, 2021/01/12
- [gnurl] 342/411: CURLOPT_HSTS.3: document the file format, gnunet, 2021/01/12
- [gnurl] 290/411: http: pass correct header size to debug callback for chunked post,
gnunet <=
- [gnurl] 377/411: socks: check for DNS entries with the right port number, gnunet, 2021/01/12
- [gnurl] 372/411: file: avoid duplicated code sequence, gnunet, 2021/01/12
- [gnurl] 376/411: curl_setup: USE_RESOLVE_ON_IPS is for Apple native resolver use, gnunet, 2021/01/12
- [gnurl] 292/411: tests: add missing global_init/cleanup calls, gnunet, 2021/01/12
- [gnurl] 356/411: openssl: guard against OOM on context creation, gnunet, 2021/01/12
- [gnurl] 280/411: mailmap: set Viktor Szakats's email, gnunet, 2021/01/12
- [gnurl] 269/411: CI/appveyor: disable test 571 in two cmake builds, gnunet, 2021/01/12
- [gnurl] 326/411: ngtcp2: adapt to recent nghttp3 updates, gnunet, 2021/01/12
- [gnurl] 411/411: add lowercase curl, gnunet, 2021/01/12
- [gnurl] 393/411: SECURITY-PROCESS: disclose on hackerone, gnunet, 2021/01/12