From 324a97ecf82e5e415c3c9fb4df093053c1efedf1 Mon Sep 17 00:00:00 2001 From: Diego Bes Date: Fri, 18 Mar 2016 15:25:56 -0700 Subject: http2: support "prior knowledge", no upgrade from HTTP/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Supports HTTP/2 over clear TCP - Optimize switching to HTTP/2 by removing calls to init and setup before switching. Switching will eventually call setup and setup calls init. - Supports new version to “force” the use of HTTP/2 over clean TCP - Add common line parameter “--http2-prior-knowledge” to the Curl command line tool. --- src/tool_getparam.c | 5 +++++ src/tool_help.c | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 61f50464b..9bb1b0c5f 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -184,6 +184,7 @@ static const struct LongShort aliases[]= { {"0", "http1.0", FALSE}, {"01", "http1.1", FALSE}, {"02", "http2", FALSE}, + {"03", "http2-prior-knowledge", FALSE}, {"1", "tlsv1", FALSE}, {"10", "tlsv1.0", FALSE}, {"11", "tlsv1.1", FALSE}, @@ -1036,6 +1037,10 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ /* HTTP version 2.0 */ config->httpversion = CURL_HTTP_VERSION_2_0; break; + case '3': + /* HTTP version 2.0 over clean TCP*/ + config->httpversion = CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE; + break; } break; case '1': /* --tlsv1* options */ diff --git a/src/tool_help.c b/src/tool_help.c index a1a6fb493..42159f4d9 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -111,6 +111,7 @@ static const char *const helptext[] = { " -0, --http1.0 Use HTTP 1.0 (H)", " --http1.1 Use HTTP 1.1 (H)", " --http2 Use HTTP 2 (H)", + " --http2-prior-knowledge Use HTTP 2 without HTTP/1.1 Upgrade (H)", " --ignore-content-length Ignore the HTTP Content-Length header", " -i, --include Include protocol headers in the output (H/F)", " -k, --insecure Allow connections to SSL sites without certs (H)", -- cgit v1.2.3