]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ConnectionExists: respect requests for h1 connections better
authorDaniel Stenberg <daniel@haxx.se>
Tue, 20 Apr 2021 08:44:12 +0000 (10:44 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 21 Apr 2021 06:20:24 +0000 (08:20 +0200)
... for situations when multiplexing isn't enabled on the h2 connection
and h1 is explicitly requested for the transfer.

Assisted-by: Gergely Nagy
lib/url.c

index 949e380aa5f7ba09933e0e8811338b750be8435e..c5e59ea99be9740c8d99803336415e807974e32a 100644 (file)
--- 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