Skip to content

Commit

Permalink
multiplex: allow only once HTTP/2 is actually used
Browse files Browse the repository at this point in the history
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 curl#584

Patch-by: c0ff
  • Loading branch information
bagder committed Jan 5, 2016
1 parent 19ca401 commit 46cb70e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/url.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 46cb70e

Please sign in to comment.