aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-01-10 01:00:06 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-01-11 23:55:13 +0100
commit13b6d3b7dd9e288daa7d2525b0c39cd5c40ef70b (patch)
treea46a7e143b4680fef89d4d70c8aea7c22ac98694
parent3d209b5fb0c792655288758d48a2703b88a84145 (diff)
ConnectionExists: only do pipelining/multiplexing when asked
When an HTTP/2 upgrade request fails (no protocol switch), it would previously detect that as still possible to pipeline on (which is acorrect) and do that when PIPEWAIT was enabled even if pipelining was not explictily enabled. It should only pipelined if explicitly asked to. Closes #584
-rw-r--r--lib/url.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 2fd0a1283..02a7aced4 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -3153,8 +3153,12 @@ ConnectionExists(struct SessionHandle *data,
size_t best_pipe_len = max_pipe_len;
struct curl_llist_element *curr;
- infof(data, "Found bundle for host %s: %p\n",
- needle->host.name, (void *)bundle);
+ infof(data, "Found bundle for host %s: %p [%s]\n",
+ needle->host.name, (void *)bundle,
+ (bundle->multiuse== BUNDLE_PIPELINING?
+ "can pipeline":
+ (bundle->multiuse== BUNDLE_MULTIPLEX?
+ "can multiplex":"serially")));
/* We can't pipe if we don't know anything about the server */
if(canPipeline) {
@@ -3168,6 +3172,17 @@ ConnectionExists(struct SessionHandle *data,
infof(data, "Server doesn't support multi-use (yet)\n");
canPipeline = FALSE;
}
+ if((bundle->multiuse == BUNDLE_PIPELINING) &&
+ !Curl_pipeline_wanted(data->multi, CURLPIPE_HTTP1)) {
+ /* not asked for, switch off */
+ infof(data, "Could pipeline, but not asked to!\n");
+ canPipeline = FALSE;
+ }
+ else if((bundle->multiuse == BUNDLE_MULTIPLEX) &&
+ !Curl_pipeline_wanted(data->multi, CURLPIPE_MULTIPLEX)) {
+ infof(data, "Could multiplex, but not asked to!\n");
+ canPipeline = FALSE;
+ }
}
curr = bundle->conn_list->head;