curl: add --http1.1 and --http2.0 options

This commit is contained in:
Daniel Stenberg 2013-09-04 22:28:16 +02:00
parent d707a975f6
commit 2eabb7d590
4 changed files with 29 additions and 7 deletions

View file

@ -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 */

View file

@ -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)",