]> granicus.if.org Git - curl/commitdiff
IsPipeliningPossible: http2 can always "pipeline" (multiplex)
authorDaniel Stenberg <daniel@haxx.se>
Thu, 7 May 2015 06:59:28 +0000 (08:59 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2015 06:57:18 +0000 (08:57 +0200)
lib/url.c

index 688dd9ea0f8066045546fe44323c8d784d50da95..dde53f0e45a5ce4c59fc7f4b2f788f646c3d8b26 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2813,13 +2813,20 @@ static bool SocketIsDead(curl_socket_t sock)
 static bool IsPipeliningPossible(const struct SessionHandle *handle,
                                  const struct connectdata *conn)
 {
+  /* If a HTTP protocol and pipelining is enabled */
   if((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
-     Curl_multi_pipeline_enabled(handle->multi) &&
-     (handle->set.httpreq == HTTPREQ_GET ||
-      handle->set.httpreq == HTTPREQ_HEAD) &&
-     handle->set.httpversion != CURL_HTTP_VERSION_1_0)
-    return TRUE;
+     Curl_multi_pipeline_enabled(handle->multi)) {
 
+    if((handle->set.httpversion != CURL_HTTP_VERSION_1_0) &&
+       (handle->set.httpreq == HTTPREQ_GET ||
+        handle->set.httpreq == HTTPREQ_HEAD))
+      /* didn't ask for HTTP/1.0 and a GET or HEAD */
+      return TRUE;
+
+    if(conn->httpversion == 20)
+      /* talking HTTP/2 */
+      return TRUE;
+  }
   return FALSE;
 }