From 9756d1da7637d1913b7ca2b589e4635f32ed3e00 Mon Sep 17 00:00:00 2001 From: Nathaniel Waisbrot Date: Sat, 22 Aug 2015 21:49:26 -0400 Subject: CURLOPT_DEFAULT_PROTOCOL: added - Add new option CURLOPT_DEFAULT_PROTOCOL to allow specifying a default protocol for schemeless URLs. - Add new tool option --proto-default to expose CURLOPT_DEFAULT_PROTOCOL. In the case of schemeless URLs libcurl will behave in this way: When the option is used libcurl will use the supplied default. When the option is not used, libcurl will follow its usual plan of guessing from the hostname and falling back to 'http'. --- src/tool_getparam.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/tool_getparam.c') diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 4405bce87..e97a1b98c 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -160,8 +160,6 @@ static const struct LongShort aliases[]= { {"$5", "noproxy", TRUE}, {"$6", "socks5-gssapi-service", TRUE}, {"$7", "socks5-gssapi-nec", FALSE}, - {"$O", "proxy-service-name", TRUE}, - {"$P", "service-name", TRUE}, {"$8", "proxy1.0", TRUE}, {"$9", "tftp-blksize", TRUE}, {"$A", "mail-from", TRUE}, @@ -178,6 +176,9 @@ static const struct LongShort aliases[]= { {"$L", "test-event", FALSE}, {"$M", "unix-socket", TRUE}, {"$N", "path-as-is", FALSE}, + {"$O", "proxy-service-name", TRUE}, + {"$P", "service-name", TRUE}, + {"$Q", "proto-default", TRUE}, {"0", "http1.0", FALSE}, {"01", "http1.1", FALSE}, {"02", "http2", FALSE}, @@ -903,12 +904,6 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ case '7': /* --socks5-gssapi-nec*/ config->socks5_gssapi_nec = toggle; break; - case 'O': /* --proxy-service-name */ - GetStr(&config->proxy_service_name, nextarg); - break; - case 'P': /* --service-name */ - GetStr(&config->service_name, nextarg); - break; case '8': /* --proxy1.0 */ /* http 1.0 proxy */ GetStr(&config->proxy, nextarg); @@ -992,6 +987,18 @@ ParameterError getparameter(char *flag, /* f or -long-flag */ case 'N': /* --path-as-is */ config->path_as_is = toggle; break; + case 'O': /* --proxy-service-name */ + GetStr(&config->proxy_service_name, nextarg); + break; + case 'P': /* --service-name */ + GetStr(&config->service_name, nextarg); + break; + case 'Q': /* --proto-default */ + GetStr(&config->proto_default, nextarg); + err = check_protocol(config->proto_default); + if(err) + return err; + break; } break; case '#': /* --progress-bar */ -- cgit v1.2.3