Browse Source

Fix: handle EAI_ALLDONE from gai_suspend in getaddrinfo_with_timeout (#2228)

kgokalp 5 tháng trước cách đây
mục cha
commit
7a3b92bbd9
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      httplib.h

+ 1 - 1
httplib.h

@@ -3776,7 +3776,7 @@ inline int getaddrinfo_with_timeout(const char *node, const char *service,
   int wait_result =
   int wait_result =
       gai_suspend((const struct gaicb *const *)requests, 1, &timeout);
       gai_suspend((const struct gaicb *const *)requests, 1, &timeout);
 
 
-  if (wait_result == 0) {
+  if (wait_result == 0 || wait_result == EAI_ALLDONE) {
     // Completed successfully, get the result
     // Completed successfully, get the result
     int gai_result = gai_error(&request);
     int gai_result = gai_error(&request);
     if (gai_result == 0) {
     if (gai_result == 0) {