]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo
authorDaniel Stenberg <daniel@haxx.se>
Sat, 6 Dec 2025 22:45:06 +0000 (23:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 6 Dec 2025 23:08:19 +0000 (00:08 +0100)
Follow-up to ce06fe77710525
Bug: https://github.com/curl/curl/commit/ce06fe7771052549ff430c86173b2eaca91f8a9c#r172215567
Reported-by: Harry Sintonen
Closes #19859

lib/asyn-thrdd.c

index e5bf0629d38f6d6e79bf9be1358ce46474390ab1..aa686271a0dd5b2acc34038bc6fafbf2192c5287 100644 (file)
@@ -725,24 +725,18 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps)
 /*
  * Curl_async_getaddrinfo() - for platforms without getaddrinfo
  */
-struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data,
-                                             const char *hostname,
-                                             int port,
-                                             int ip_version,
-                                             int *waitp)
+CURLcode Curl_async_getaddrinfo(struct Curl_easy *data, const char *hostname,
+                                int port, int ip_version)
 {
   (void)ip_version;
-  *waitp = 0; /* default to synchronous response */
 
   /* fire up a new resolver thread! */
   if(async_thrdd_init(data, hostname, port, ip_version, NULL)) {
-    *waitp = 1; /* expect asynchronous response */
-    return NULL;
+    return CURLE_OK;
   }
 
   failf(data, "getaddrinfo() thread failed");
-
-  return NULL;
+  return CURLE_FAILED_INIT;
 }
 
 #else /* !HAVE_GETADDRINFO */