]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thrdd: fix Curl_async_pollset without socketpair
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 Aug 2025 07:54:50 +0000 (09:54 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Aug 2025 11:03:51 +0000 (13:03 +0200)
- remove a superfluous if()
- edit the #ifdef to only do the timeout checks when socketpair support
  is missing, as that code flow could not be reached otherways anyway

CodeSonar pointed out possible issue that led me to see this.

Closes #18306

lib/asyn-thrdd.c

index 509ec427a8777a0db2601d36b2112b4098fb2f08..7884dc166a36266e2b2088e5b9470a51f7bce07b 100644 (file)
@@ -655,12 +655,9 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps)
     return result;
 
 #ifndef CURL_DISABLE_SOCKETPAIR
-  if(thrdd->addr) {
-    /* return read fd to client for polling the DNS resolution status */
-    result = Curl_pollset_add_in(data, ps, thrdd->addr->sock_pair[0]);
-  }
-  else
-#endif
+  /* return read fd to client for polling the DNS resolution status */
+  result = Curl_pollset_add_in(data, ps, thrdd->addr->sock_pair[0]);
+#else
   {
     timediff_t milli;
     timediff_t ms = curlx_timediff(curlx_now(), thrdd->addr->start);
@@ -674,7 +671,7 @@ CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps)
       milli = 200;
     Curl_expire(data, milli, EXPIRE_ASYNC_NAME);
   }
-
+#endif
   return result;
 }