]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test504: fix handling on pending connect
authorStefan Eissing <stefan@eissing.org>
Thu, 26 Sep 2024 12:43:54 +0000 (14:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 26 Sep 2024 14:57:51 +0000 (16:57 +0200)
Test expected a connect to a port no one is listening to immediately
fail. But Windows has its internal retry logic that may fail this.

As fix, multi_perform()/multi_wait() until transfer is done.

Closes #15054

tests/libtest/lib504.c

index 984ce279840c131588643afe3f1786d98dfbcb03..a9f96c8ddeab32eaace6bb8399c92bbf636903d6 100644 (file)
@@ -72,6 +72,21 @@ CURLcode test(char *URL)
 
     multi_perform(m, &running);
 
+    while(running) {
+      CURLMcode mres;
+      int num;
+      mres = curl_multi_wait(m, NULL, 0, TEST_HANG_TIMEOUT, &num);
+      if(mres != CURLM_OK) {
+        printf("curl_multi_wait() returned %d\n", mres);
+        res = TEST_ERR_MAJOR_BAD;
+        goto test_cleanup;
+      }
+
+      abort_on_test_timeout();
+      multi_perform(m, &running);
+      abort_on_test_timeout();
+    }
+
     abort_on_test_timeout();
 
     if(!running) {