aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-01-05 11:32:30 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-01-06 00:54:49 +0100
commit46cb70e9fa81c9a56de484cdd7c5d9d0d9fbec36 (patch)
tree45f7e70363f63d3d9cbcffc5c17c97786d1c06d7
parent19ca40100bf5ca5ee8511b193bdb1f8e95152664 (diff)
multiplex: allow only once HTTP/2 is actually used
To make sure curl doesn't allow multiplexing before a connection is upgraded to HTTP/2 (like when Upgrade: h2c fails), we must make sure the connection uses HTTP/2 as well and not only check what's wanted. Closes #584 Patch-by: c0ff
-rw-r--r--lib/url.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index be2f2f896..875cb8b20 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
@@ -2865,8 +2865,9 @@ static bool IsPipeliningPossible(const struct SessionHandle *handle,
return TRUE;
if(Curl_pipeline_wanted(handle->multi, CURLPIPE_MULTIPLEX) &&
- (handle->set.httpversion >= CURL_HTTP_VERSION_2))
- /* allows HTTP/2 */
+ (handle->set.httpversion >= CURL_HTTP_VERSION_2) &&
+ (conn->httpversion >= 20))
+ /* allows and uses HTTP/2 */
return TRUE;
}
return FALSE;