diff options
author | Anders Bakken <agbakken@gmail.com> | 2018-01-30 16:33:51 -0800 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2018-02-20 17:51:43 -0500 |
commit | 2427d94c6d088b13ad971bb3cee5b7de42b37d24 (patch) | |
tree | bbec8183cff0f20d8bd214abdcab5b66f1737669 /lib/connect.c | |
parent | 73050fb6ae3c58b6e5d085e8463d94b79dbf2737 (diff) | |
download | curl-2427d94c6d088b13ad971bb3cee5b7de42b37d24.tar.gz |
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
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c index c3add43cc..1a27ae135 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -783,7 +783,8 @@ CURLcode Curl_is_connected(struct connectdata *conn, /* should we try another protocol family? */ if(i == 0 && conn->tempaddr[1] == NULL && - Curl_timediff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) { + (Curl_timediff(now, conn->connecttime) >= + data->set.happy_eyeballs_timeout)) { trynextip(conn, sockindex, 1); } } @@ -1206,7 +1207,8 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ } data->info.numconnects++; /* to track the number of connections made */ - Curl_expire(conn->data, HAPPY_EYEBALLS_TIMEOUT, EXPIRE_HAPPY_EYEBALLS); + Curl_expire(conn->data, data->set.happy_eyeballs_timeout, + EXPIRE_HAPPY_EYEBALLS); return CURLE_OK; } |