]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: don't use alarm() for DoH resolves
authorDaniel Stenberg <daniel@haxx.se>
Mon, 10 Mar 2025 11:02:58 +0000 (12:02 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Mar 2025 12:17:18 +0000 (13:17 +0100)
When built to use the synch resolver and DoH is used for a transfer, do
not use alarm() for timeout since DoH resolving is not blocking.

Closes #16649

lib/hostip.c

index e335ca0fc7af9d929a41767c44317c86705636ff..d92999a65049a5835c7a61c1ef40d75b254bcb73 100644 (file)
@@ -932,8 +932,9 @@ enum resolve_t Curl_resolv_timeout(struct Curl_easy *data,
   else
     timeout = (timeoutms > LONG_MAX) ? LONG_MAX : (long)timeoutms;
 
-  if(!timeout)
-    /* USE_ALARM_TIMEOUT defined, but no timeout actually requested */
+  if(!timeout || data->set.doh)
+    /* USE_ALARM_TIMEOUT defined, but no timeout actually requested or resolve
+       done using DoH */
     return Curl_resolv(data, hostname, port, TRUE, entry);
 
   if(timeout < 1000) {