mirror of
https://github.com/curl/curl.git
synced 2026-08-05 17:36:13 +03:00
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
This commit is contained in:
parent
a5ab72d5ed
commit
0842175fa4
3 changed files with 100 additions and 54 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue