doh: return early if there is no time left

Closes #4406
This commit is contained in:
Paul Dreik 2019-09-23 13:10:12 +02:00 committed by Daniel Stenberg
parent 0023fce38d
commit bb74201804
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 4 additions and 1 deletions

View File

@ -240,7 +240,10 @@ static CURLcode dohprobe(struct Curl_easy *data,
}
timeout_ms = Curl_timeleft(data, NULL, TRUE);
if(timeout_ms <= 0) {
result = CURLE_OPERATION_TIMEDOUT;
goto error;
}
/* Curl_open() is the internal version of curl_easy_init() */
result = Curl_open(&doh);
if(!result) {