diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2023-03-10 13:15:43 -0800 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2023-03-11 18:57:19 -0800 |
commit | ee521a1c889f4cde6905c5db117959917568be9b (patch) | |
tree | d1c0b8a61e0ad324aaece6eb0ecaeb6329a750c1 /lib | |
parent | 970330bdedb7fd943ce3fc0c0272ce7306263506 (diff) | |
download | curl-ee521a1c889f4cde6905c5db117959917568be9b.tar.gz |
http: don't send 100-continue for short PUT requests
This is already how curl is documented to behave in Everything curl, but
in actuality only short POSTs skip this. This should knock 30 seconds
off a full run of the test suite since the 100-continue timeout will no
longer be hit.
Closes #10740
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c index 299a499f0..faa486cc6 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2340,7 +2340,16 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn, return result; } - if(http->postsize) { + /* For really small puts we don't use Expect: headers at all, and for + the somewhat bigger ones we allow the app to disable it. Just make + sure that the expect100header is always set to the preferred value + here. */ + ptr = Curl_checkheaders(data, STRCONST("Expect")); + if(ptr) { + data->state.expect100header = + Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue")); + } + else if(http->postsize > EXPECT_100_THRESHOLD || http->postsize < 0) { result = expect100(data, conn, r); if(result) return result; |