diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-09-04 22:28:16 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-09-04 22:29:38 +0200 |
commit | 2eabb7d590aaa14c211e3a306582ff36fc3fc0f5 (patch) | |
tree | 4f863237b5cb870e11282d4d78e90df5b0b61726 /src | |
parent | d707a975f645a2b25edb926f475b9abe94fe830a (diff) |
curl: add --http1.1 and --http2.0 options
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_getparam.c | 22 | ||||
-rw-r--r-- | src/tool_help.c | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 45194235a..482f467eb 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -176,7 +176,9 @@ static const struct LongShort aliases[]= { {"$J", "metalink", FALSE}, {"$K", "sasl-ir", FALSE}, {"$L", "test-event", FALSE}, - {"0", "http1.0", FALSE}, + {"00", "http1.0", FALSE}, + {"01", "http1.1", FALSE}, + {"02", "http2.0", FALSE}, {"1", "tlsv1", FALSE}, {"2", "sslv2", FALSE}, {"3", "sslv3", FALSE}, @@ -985,9 +987,21 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ case '~': /* --xattr */ config->xattr = toggle; break; - case '0': - /* HTTP version 1.0 */ - config->httpversion = CURL_HTTP_VERSION_1_0; + case '0': /* --http* options */ + switch(subletter) { + case '0': + /* HTTP version 1.0 */ + config->httpversion = CURL_HTTP_VERSION_1_0; + break; + case '1': + /* HTTP version 1.1 */ + config->httpversion = CURL_HTTP_VERSION_1_1; + break; + case '2': + /* HTTP version 2.0 */ + config->httpversion = CURL_HTTP_VERSION_2_0; + break; + } break; case '1': /* TLS version 1 */ diff --git a/src/tool_help.c b/src/tool_help.c index d89a87ee4..5ae39af77 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -100,6 +100,8 @@ static const char *const helptext[] = { " --hostpubmd5 MD5 " "Hex encoded MD5 string of the host public key. (SSH)", " -0, --http1.0 Use HTTP 1.0 (H)", + " --http1.1 Use HTTP 1.1 (H)", + " --http2.0 Use HTTP 2.0 (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)", |