From 2427d94c6d088b13ad971bb3cee5b7de42b37d24 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Tue, 30 Jan 2018 16:33:51 -0800 Subject: url: Add option CURLOPT_HAPPY_EYEBALLS_TIMEOUT - Add new option CURLOPT_HAPPY_EYEBALLS_TIMEOUT to set libcurl's happy eyeball timeout value. - Add new optval macro CURL_HET_DEFAULT to represent the default happy eyeballs timeout value (currently 200 ms). - Add new tool option --happy-eyeballs-timeout-ms to expose CURLOPT_HAPPY_EYEBALLS_TIMEOUT. The -ms suffix is used because the other -timeout options in the tool expect seconds not milliseconds. Closes https://github.com/curl/curl/pull/2260 --- src/tool_getparam.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/tool_getparam.c') diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 46e7dd3cd..c6b1a0d6f 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -190,6 +190,7 @@ static const struct LongShort aliases[]= { {"$X", "tls-max", ARG_STRING}, {"$Y", "suppress-connect-headers", ARG_BOOL}, {"$Z", "compressed-ssh", ARG_BOOL}, + {"$~", "happy-eyeballs-timeout-ms", ARG_STRING}, {"0", "http1.0", ARG_NONE}, {"01", "http1.1", ARG_NONE}, {"02", "http2", ARG_NONE}, @@ -1111,6 +1112,12 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ case 'Z': /* --compressed-ssh */ config->ssh_compression = toggle; break; + case '~': /* --happy-eyeballs-timeout-ms */ + err = str2unum(&config->happy_eyeballs_timeout_ms, nextarg); + if(err) + return err; + /* 0 is a valid value for this timeout */ + break; } break; case '#': /* --progress-bar */ -- cgit v1.2.3