aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-04-27 12:52:07 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-05-18 08:54:54 +0200
commitf8586240522fe2405759ad6cb57eb2d4b142907c (patch)
tree091a7153a3e7e4354613c0e1f767deb038cca20d
parent6e6b02f398091140a9841fb0e9f9566a8905a1b8 (diff)
Curl_http2_setup: only do it once and enable multiplex on the server
Once we know we are HTTP/2 enabled we know the server can multiplex.
-rw-r--r--lib/http2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 9ff25803d..d01b52efd 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -32,6 +32,7 @@
#include "curl_base64.h"
#include "rawstr.h"
#include "multiif.h"
+#include "bundles.h"
/* The last #include files should be: */
#include "curl_memory.h"
@@ -972,6 +973,11 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
{
CURLcode result;
struct http_conn *httpc = &conn->proto.httpc;
+
+ if((conn->handler == &Curl_handler_http2_ssl) ||
+ (conn->handler == &Curl_handler_http2))
+ return CURLE_OK; /* already done */
+
if(conn->handler->flags & PROTOPT_SSL)
conn->handler = &Curl_handler_http2_ssl;
else
@@ -981,7 +987,7 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
if(result)
return result;
- infof(conn->data, "Using HTTP2\n");
+ infof(conn->data, "Using HTTP2, server supports multi-use\n");
httpc->bodystarted = FALSE;
httpc->error_code = NGHTTP2_NO_ERROR;
httpc->closed = FALSE;
@@ -996,6 +1002,7 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
httpc->status_code = -1;
conn->httpversion = 20;
+ conn->bundle->server_supports_pipelining = TRUE;
return CURLE_OK;
}