summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Dreik <github@pauldreik.se>2019-09-23 13:10:12 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-09-23 22:38:15 +0200
commitbb7420180497f6087cd2d894253beb2532a0569e (patch)
tree9788d42a91d7a4ab78d094b934c26f2ff54e79f0 /lib
parent0023fce38d3bd6ee0e9b6ff8708fee1195057846 (diff)
downloadcurl-bb7420180497f6087cd2d894253beb2532a0569e.tar.gz
doh: return early if there is no time left
Closes #4406
Diffstat (limited to 'lib')
-rw-r--r--lib/doh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/doh.c b/lib/doh.c
index 5a76d6d87..05a6cc235 100644
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -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) {