From dd027c80fe444e9555ad324ddf8e461eb358f4a3 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Wed, 21 Feb 2018 15:16:50 -0500 Subject: lib: CURLOPT_HAPPY_EYEBALLS_TIMEOUT => CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS - In keeping with the naming of our other connect timeout options rename CURLOPT_HAPPY_EYEBALLS_TIMEOUT to CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS. This change adds the _MS suffix since the option expects milliseconds. This is more intuitive for our users since other connect timeout options that expect milliseconds use _MS such as CURLOPT_TIMEOUT_MS, CURLOPT_CONNECTTIMEOUT_MS, CURLOPT_ACCEPTTIMEOUT_MS. The tool option already uses an -ms suffix, --happy-eyeballs-timeout-ms. Follow-up to 2427d94 which added the lib and tool option yesterday. Ref: https://github.com/curl/curl/pull/2260 --- RELEASE-NOTES | 2 +- docs/libcurl/curl_easy_setopt.3 | 4 +- docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 | 59 ---------------------- .../opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 | 59 ++++++++++++++++++++++ docs/libcurl/opts/Makefile.inc | 2 +- docs/libcurl/symbols-in-versions | 2 +- include/curl/curl.h | 4 +- lib/setopt.c | 2 +- packages/OS400/curl.inc.in | 2 +- src/tool_operate.c | 2 +- 10 files changed, 69 insertions(+), 69 deletions(-) delete mode 100644 docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 create mode 100644 docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5a26b73bb..cac5bcc6b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -11,7 +11,7 @@ This release includes the following changes: o curl: add --proxy-pinnedpubkey [10] o added: CURLOPT_TIMEVALUE_LARGE and CURLINFO_FILETIME_T [13] o CURLOPT_RESOLVE: Add support for multiple IP addresses per entry [37] - o Add option CURLOPT_HAPPY_EYEBALLS_TIMEOUT [37] + o Add option CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS [37] o Add new tool option --happy-eyeballs-timeout-ms [37] This release includes the following bugfixes: diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3 index 72ef2886a..c7bd524ad 100644 --- a/docs/libcurl/curl_easy_setopt.3 +++ b/docs/libcurl/curl_easy_setopt.3 @@ -464,6 +464,8 @@ Bind name resolves to this IP6 address. See \fICURLOPT_DNS_LOCAL_IP6(3)\fP Preferred DNS servers. See \fICURLOPT_DNS_SERVERS(3)\fP .IP CURLOPT_ACCEPTTIMEOUT_MS Timeout for waiting for the server's connect back to be accepted. See \fICURLOPT_ACCEPTTIMEOUT_MS(3)\fP +.IP CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS +Timeout for happy eyeballs. See \fICURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS(3)\fP .SH SSL and SECURITY OPTIONS .IP CURLOPT_SSLCERT Client cert. See \fICURLOPT_SSLCERT(3)\fP @@ -577,8 +579,6 @@ Mode for creating new remote directories. See \fICURLOPT_NEW_DIRECTORY_PERMS(3)\ .SH TELNET OPTIONS .IP CURLOPT_TELNETOPTIONS TELNET options. See \fICURLOPT_TELNETOPTIONS(3)\fP -.IP CURLOPT_HAPPY_EYEBALLS_TIMEOUT -Timeout for happy eyeballs. See \fICURLOPT_HAPPY_EYEBALLS_TIMEOUT(3)\fP .SH RETURN VALUE \fICURLE_OK\fP (zero) means that the option was set properly, non-zero means an error occurred as \fI\fP defines. See the \fIlibcurl-errors(3)\fP diff --git a/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 b/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 deleted file mode 100644 index d4fa1505b..000000000 --- a/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" ************************************************************************** -.\" * _ _ ____ _ -.\" * Project ___| | | | _ \| | -.\" * / __| | | | |_) | | -.\" * | (__| |_| | _ <| |___ -.\" * \___|\___/|_| \_\_____| -.\" * -.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. -.\" * -.\" * This software is licensed as described in the file COPYING, which -.\" * you should have received as part of this distribution. The terms -.\" * are also available at https://curl.haxx.se/docs/copyright.html. -.\" * -.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell -.\" * copies of the Software, and permit persons to whom the Software is -.\" * furnished to do so, under the terms of the COPYING file. -.\" * -.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -.\" * KIND, either express or implied. -.\" * -.\" ************************************************************************** -.\" -.TH CURLOPT_HAPPY_EYEBALLS_TIMEOUT 3 "1 Feb 2018" "libcurl 7.59.0" "curl_easy_setopt options" -.SH NAME -CURLOPT_HAPPY_EYEBALLS_TIMEOUT \- head start for ipv6 for happy eyeballs -.SH SYNOPSIS -#include - -CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPPY_EYEBALLS_TIMEOUT, long timeout); -.SH DESCRIPTION -Happy eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 -addresses for dual-stack hosts, preferring IPv6 first for \fItimeout\fP -milliseconds. If the IPv6 address cannot be connected to within that time then -a connection attempt is made to the IPv4 address in parallel. The first -connection to be established is the one that is used. - -The range of suggested useful values for \fItimeout\fP is limited. Happy -Eyeballs RFC 6555 says "It is RECOMMENDED that connection attempts be paced -150-250 ms apart to balance human factors against network load." libcurl -currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms. -.SH DEFAULT -CURL_HET_DEFAULT (currently defined as 200L) -.SH EXAMPLE -.nf -CURL *curl = curl_easy_init(); -if(curl) { - curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); - curl_easy_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT, 300L); - - curl_easy_perform(curl); - - /* always cleanup */ - curl_easy_cleanup(curl); -} -.fi -.SH AVAILABILITY -Added in 7.59.0 -.SH RETURN VALUE -Returns CURLE_OK diff --git a/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 b/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 new file mode 100644 index 000000000..df6694877 --- /dev/null +++ b/docs/libcurl/opts/CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 @@ -0,0 +1,59 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at https://curl.haxx.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" ************************************************************************** +.\" +.TH CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS 3 "1 Feb 2018" "libcurl 7.59.0" "curl_easy_setopt options" +.SH NAME +CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS \- head start for ipv6 for happy eyeballs +.SH SYNOPSIS +#include + +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, long timeout); +.SH DESCRIPTION +Happy eyeballs is an algorithm that attempts to connect to both IPv4 and IPv6 +addresses for dual-stack hosts, preferring IPv6 first for \fItimeout\fP +milliseconds. If the IPv6 address cannot be connected to within that time then +a connection attempt is made to the IPv4 address in parallel. The first +connection to be established is the one that is used. + +The range of suggested useful values for \fItimeout\fP is limited. Happy +Eyeballs RFC 6555 says "It is RECOMMENDED that connection attempts be paced +150-250 ms apart to balance human factors against network load." libcurl +currently defaults to 200 ms. Firefox and Chrome currently default to 300 ms. +.SH DEFAULT +CURL_HET_DEFAULT (currently defined as 200L) +.SH EXAMPLE +.nf +CURL *curl = curl_easy_init(); +if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); + curl_easy_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, 300L); + + curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); +} +.fi +.SH AVAILABILITY +Added in 7.59.0 +.SH RETURN VALUE +Returns CURLE_OK diff --git a/docs/libcurl/opts/Makefile.inc b/docs/libcurl/opts/Makefile.inc index d0597500a..0cebc46d4 100644 --- a/docs/libcurl/opts/Makefile.inc +++ b/docs/libcurl/opts/Makefile.inc @@ -136,7 +136,7 @@ man_MANS = \ CURLOPT_FTP_USE_EPSV.3 \ CURLOPT_FTP_USE_PRET.3 \ CURLOPT_GSSAPI_DELEGATION.3 \ - CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 \ + CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 \ CURLOPT_HEADER.3 \ CURLOPT_HEADERDATA.3 \ CURLOPT_HEADERFUNCTION.3 \ diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index 44f111b05..e3cb469f3 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -403,7 +403,7 @@ CURLOPT_FTP_USE_EPRT 7.10.5 CURLOPT_FTP_USE_EPSV 7.9.2 CURLOPT_FTP_USE_PRET 7.20.0 CURLOPT_GSSAPI_DELEGATION 7.22.0 -CURLOPT_HAPPY_EYEBALLS_TIMEOUT 7.59.0 +CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS 7.59.0 CURLOPT_HEADER 7.1 CURLOPT_HEADERDATA 7.10 CURLOPT_HEADERFUNCTION 7.7.2 diff --git a/include/curl/curl.h b/include/curl/curl.h index a592a0e4d..93954bca5 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -792,7 +792,7 @@ typedef enum { #define CURLSSLOPT_NO_REVOKE (1<<1) /* The default connection attempt delay in milliseconds for happy eyeballs. - CURLOPT_HAPPY_EYEBALLS_TIMEOUT.3 and happy-eyeballs-timeout-ms.d document + CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document this value, keep them in sync. */ #define CURL_HET_DEFAULT 200L @@ -1831,7 +1831,7 @@ typedef enum { CINIT(TIMEVALUE_LARGE, OFF_T, 270), /* Head start in milliseconds to give happy eyeballs. */ - CINIT(HAPPY_EYEBALLS_TIMEOUT, LONG, 271), + CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271), CURLOPT_LASTENTRY /* the last unused */ } CURLoption; diff --git a/lib/setopt.c b/lib/setopt.c index f03e6d5fa..8dcd10e6b 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2533,7 +2533,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, case CURLOPT_SSH_COMPRESSION: data->set.ssh_compression = (0 != va_arg(param, long))?TRUE:FALSE; break; - case CURLOPT_HAPPY_EYEBALLS_TIMEOUT: + case CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS: arg = va_arg(param, long); if(arg < 0) return CURLE_BAD_FUNCTION_ARGUMENT; diff --git a/packages/OS400/curl.inc.in b/packages/OS400/curl.inc.in index 1b2996894..3852dde7a 100644 --- a/packages/OS400/curl.inc.in +++ b/packages/OS400/curl.inc.in @@ -1324,7 +1324,7 @@ d c 10269 d CURLOPT_TIMEVALUE_LARGE... d c 30270 - d CURLOPT_HAPPY_EYEBALLS_TIMEOUT... + d CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS... d c 00271 * /if not defined(CURL_NO_OLDIES) diff --git a/src/tool_operate.c b/src/tool_operate.c index c8e9c6901..e8b434a53 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1442,7 +1442,7 @@ static CURLcode operate_do(struct GlobalConfig *global, /* new in 7.59.0 */ if(config->happy_eyeballs_timeout_ms != CURL_HET_DEFAULT) - my_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT, + my_setopt(curl, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, config->happy_eyeballs_timeout_ms); /* initialize retry vars for loop below */ -- cgit v1.2.3