summaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-02-24 13:47:57 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-02-24 14:20:57 +0100
commit46bf7996f43a4c47b00dde6d127d50f9faea9dd9 (patch)
treeb0dffc0ba26e5b61a4e569723c79808c6cbf0fe1 /lib/sendf.c
parentcac8c3206fbd8e8da184efeaa5c280347dff7139 (diff)
downloadcurl-46bf7996f43a4c47b00dde6d127d50f9faea9dd9.tar.gz
Curl_read: check for activated HTTP/1 pipelining, not only requested
... as when pipelining is used, we read things into a unified buffer and we don't do that with HTTP/2. This could then easily make programs that set CURLMOPT_PIPELINING = CURLPIPE_HTTP1|CURLPIPE_MULTIPLEX to get data intermixed or plain broken between HTTP/2 streams. Reported-by: Anders Bakken
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index eca764f73..ea04ae83e 100644
--- a/lib/sendf.c
+++ b/lib/sendf.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
@@ -553,7 +553,10 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */
ssize_t nread = 0;
size_t bytesfromsocket = 0;
char *buffertofill = NULL;
- bool pipelining = Curl_pipeline_wanted(conn->data->multi, CURLPIPE_HTTP1);
+
+ /* if HTTP/1 pipelining is both wanted and possible */
+ bool pipelining = Curl_pipeline_wanted(conn->data->multi, CURLPIPE_HTTP1) &&
+ (conn->bundle->multiuse == BUNDLE_PIPELINING);
/* Set 'num' to 0 or 1, depending on which socket that has been sent here.
If it is the second socket, we set num to 1. Otherwise to 0. This lets