diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-08-23 14:20:08 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-08-23 16:12:33 +0200 |
commit | e5d77dc2ca7d047a55aa56f156f5651352386c1b (patch) | |
tree | f1b2f041010c5c63b4ecc5c801e78e0ce149d81a /lib/http.c | |
parent | 38941ad6f315b9277833df74b9feb6b2df3f50e2 (diff) | |
download | curl-e5d77dc2ca7d047a55aa56f156f5651352386c1b.tar.gz |
c-hyper: handle HTTP/1.1 => HTTP/1.0 downgrade on reused connection
Enable test 1074
Closes #7617
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/http.c b/lib/http.c index 54362362a..d0026c4da 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1669,8 +1669,8 @@ CURLcode Curl_http_done(struct Curl_easy *data, * - if any server previously contacted to handle this request only supports * 1.0. */ -static bool use_http_1_1plus(const struct Curl_easy *data, - const struct connectdata *conn) +bool Curl_use_http_1_1plus(const struct Curl_easy *data, + const struct connectdata *conn) { if((data->state.httpversion == 10) || (conn->httpversion == 10)) return FALSE; @@ -1696,7 +1696,7 @@ static const char *get_http_string(const struct Curl_easy *data, return "2"; #endif - if(use_http_1_1plus(data, conn)) + if(Curl_use_http_1_1plus(data, conn)) return "1.1"; return "1.0"; @@ -1711,7 +1711,7 @@ static CURLcode expect100(struct Curl_easy *data, CURLcode result = CURLE_OK; data->state.expect100header = FALSE; /* default to false unless it is set to TRUE below */ - if(!data->state.disableexpect && use_http_1_1plus(data, conn) && + if(!data->state.disableexpect && Curl_use_http_1_1plus(data, conn) && (conn->httpversion < 20)) { /* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an Expect: 100-continue to the headers which actually speeds up post @@ -2348,7 +2348,7 @@ CURLcode Curl_http_body(struct Curl_easy *data, struct connectdata *conn, if(conn->bits.authneg) /* don't enable chunked during auth neg */ ; - else if(use_http_1_1plus(data, conn)) { + else if(Curl_use_http_1_1plus(data, conn)) { if(conn->httpversion < 20) /* HTTP, upload, unknown file size and not HTTP 1.0 */ data->req.upload_chunky = TRUE; |