summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorRichard Whitehouse <richard.whitehouse@metaswitch.com>2017-11-30 16:56:53 +0000
committerDaniel Stenberg <daniel@haxx.se>2021-06-24 15:51:39 +0200
commit0842175fa46a2f02bc95af3cafd6901130c562dd (patch)
treec9402548db3f64edc3ad6805dd83ab6e8417cbc8 /lib/url.c
parenta5ab72d5edd72eba3485c790b42006d407e6f162 (diff)
downloadcurl-0842175fa46a2f02bc95af3cafd6901130c562dd.tar.gz
multi: alter transfer timeout ordering
- Check whether a connection has succeded before checking whether it's timed out. This means if we've connected quickly, but subsequently been descheduled, we allow the connection to succeed. Note, if we timeout, but between checking the timeout, and connecting to the server the connection succeeds, we will allow it to go ahead. This is viewed as an acceptable trade off. - Add additional failf logging around failed connection attempts to propogate the cause up to the caller. Co-Authored-by: Martin Howarth Closes #7178
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 9a96e6a93..28594e87b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3374,9 +3374,12 @@ static CURLcode resolve_server(struct Curl_easy *data,
if(rc == CURLRESOLV_PENDING)
*async = TRUE;
- else if(rc == CURLRESOLV_TIMEDOUT)
+ else if(rc == CURLRESOLV_TIMEDOUT) {
+ failf(data, "Failed to resolve host '%s' with timeout after %ld ms",
+ connhost->dispname,
+ Curl_timediff(Curl_now(), data->progress.t_startsingle));
result = CURLE_OPERATION_TIMEDOUT;
-
+ }
else if(!hostaddr) {
failf(data, "Could not resolve host: %s", connhost->dispname);
result = CURLE_COULDNT_RESOLVE_HOST;