summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-04-20 10:44:12 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-04-20 10:44:12 +0200
commit7e0a0025347eb866def9de847971372dc8b106f4 (patch)
tree0a051e528b0fbf916a1d3ac278ac81ad422ea4dd
parent88a7a6d8f3851fdd12741d7ff181d5cc7f1c2bb1 (diff)
downloadcurl-bagder/h1-reuse-not-h2.tar.gz
ConnectionExists: respect requests for h1 connections betterbagder/h1-reuse-not-h2
... for situations when multiplexing isn't enabled on the h2 connection and h1 is explicitly requested for the transfer. Assisted-by: Gergely Nagy
-rw-r--r--lib/url.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 949e380aa..c5e59ea99 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1315,6 +1315,13 @@ ConnectionExists(struct Curl_easy *data,
}
}
+ /* If multiplexing isn't enabled on the h2 connection and h1 is
+ explicitly requested, handle it: */
+ if((needle->handler->protocol & PROTO_FAMILY_HTTP) &&
+ (check->httpversion >= 20) &&
+ (data->state.httpwant < CURL_HTTP_VERSION_2_0))
+ continue;
+
if((needle->handler->flags&PROTOPT_SSL)
#ifndef CURL_DISABLE_PROXY
|| !needle->bits.httpproxy || needle->bits.tunnel_proxy