From: Stefan Eissing Date: Thu, 26 Sep 2024 12:43:54 +0000 (+0200) Subject: test504: fix handling on pending connect X-Git-Tag: curl-8_11_0~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbbf4d8ed20662d24091fc5b9f364d135ba117b1;p=thirdparty%2Fcurl.git test504: fix handling on pending connect 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 --- diff --git a/tests/libtest/lib504.c b/tests/libtest/lib504.c index 984ce27984..a9f96c8dde 100644 --- a/tests/libtest/lib504.c +++ b/tests/libtest/lib504.c @@ -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) {