]> granicus.if.org Git - curl/commitdiff
ConnectionExists: improve non-multiplexing use case
authorDaniel Stenberg <daniel@haxx.se>
Tue, 30 Apr 2019 09:16:53 +0000 (11:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 1 May 2019 20:51:23 +0000 (22:51 +0200)
- better log output

- make sure multiplex is enabled for it to be used

lib/url.c

index ad8aa699656d034412b04b21bc710617b6d317c7..5b3ce11f24c896351bf8eaf3310f95eb2970e068 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1031,7 +1031,7 @@ ConnectionExists(struct Curl_easy *data,
 
     /* We can't multiplex if we don't know anything about the server */
     if(canmultiplex) {
-      if(bundle->multiuse <= BUNDLE_UNKNOWN) {
+      if(bundle->multiuse == BUNDLE_UNKNOWN) {
         if((bundle->multiuse == BUNDLE_UNKNOWN) && data->set.pipewait) {
           infof(data, "Server doesn't support multiplex yet, wait\n");
           *waitpipe = TRUE;
@@ -1047,6 +1047,10 @@ ConnectionExists(struct Curl_easy *data,
         infof(data, "Could multiplex, but not asked to!\n");
         canmultiplex = FALSE;
       }
+      if(bundle->multiuse == BUNDLE_NO_MULTIUSE) {
+        infof(data, "Can not multiplex, even if we wanted to!\n");
+        canmultiplex = FALSE;
+      }
     }
 
     curr = bundle->conn_list.head;
@@ -1071,7 +1075,8 @@ ConnectionExists(struct Curl_easy *data,
         continue;
       }
 
-      multiplexed = CONN_INUSE(check);
+      multiplexed = CONN_INUSE(check) &&
+        (bundle->multiuse == BUNDLE_MULTIPLEX);
 
       if(canmultiplex) {
         if(check->bits.protoconnstart && check->bits.close)