http: prefer chunked encoding over Content-Length: 0#21706
http: prefer chunked encoding over Content-Length: 0#21706malyzelenyhnus wants to merge 1 commit into
Conversation
6cebe13 to
a33bfce
Compare
|
Analysis of PR #21706 at 6cebe13c: Test 795 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them). Generated by Testclutch |
|
Please rebase on master to fix the many CI errors. (it's due to a mistake I made) |
a33bfce to
5ab33fc
Compare
|
Is this gated on the use of HTTP/1.1 since chunked encoding isn't supported on earlier versions?
|
This patch should only fix the conflict between chunked encoding and Content-Length headers - it's broken for the special case when Content-Length is zero. It should not change the current curl behavior in other ways. And yes, chunked encoding should no be enabled in HTTP/1.0 and it looks like curl does not check the version. But IMO that's different issue. |
Yes, the patch looks correct. When
Well, a HTTP/1.0 response should not carry |
|
Thanks, can you check the conflict and force-push? Someone else stole the test number you used! |
5ab33fc to
12a8b7e
Compare
Call http_size() before checking the request for empty body to prefer Transfer-Encoding: chunked even if Content-Length is 0.
12a8b7e to
6f3041d
Compare
|
Thanks! |
Call http_size() before checking the request for empty body to prefer Transfer-Encoding: chunked even if Content-Length is 0. Closes curl#21706
Call http_size() before checking the request for empty body to prefer Transfer-Encoding: chunked even if Content-Length is 0. Closes curl#21706
Call http_size() before checking the request for empty body to prefer Transfer-Encoding: chunked even if Content-Length is 0.
http_size() sets
k->maxdownloadto-1if both headers are present to ignore content-length so it must be called before following code:Current ordering causes that with
Content-Length : 0isk->download_doneset toTruepreventing remaining chunked data from being read.