aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_callback.c
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-16 19:30:25 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-16 19:30:25 +0300
commitb812b174c3b4da28a93e3300064d63dd865b2178 (patch)
tree28ed28755e0876215a305956f968665730abfed8 /src/testcurl/test_callback.c
parent303d42fdcd8f029f4bf3cfb6401aec407c1626f4 (diff)
downloadlibmicrohttpd-b812b174c3b4da28a93e3300064d63dd865b2178.tar.gz
libmicrohttpd-b812b174c3b4da28a93e3300064d63dd865b2178.zip
tests: improved handling of curl multi_*
Diffstat (limited to 'src/testcurl/test_callback.c')
-rw-r--r--src/testcurl/test_callback.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/testcurl/test_callback.c b/src/testcurl/test_callback.c
index 5fdfa4b3..d2894c06 100644
--- a/src/testcurl/test_callback.c
+++ b/src/testcurl/test_callback.c
@@ -220,7 +220,7 @@ main (int argc, char **argv)
220 abort (); 220 abort ();
221#else 221#else
222 if ((WSAEINVAL != WSAGetLastError ()) || 222 if ((WSAEINVAL != WSAGetLastError ()) ||
223 (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) 223 (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count))
224 abort (); 224 abort ();
225 Sleep (1000); 225 Sleep (1000);
226#endif 226#endif
@@ -228,24 +228,26 @@ main (int argc, char **argv)
228 if (NULL != multi) 228 if (NULL != multi)
229 { 229 {
230 curl_multi_perform (multi, &running); 230 curl_multi_perform (multi, &running);
231 if (running == 0) 231 if (0 == running)
232 { 232 {
233 int pending; 233 int pending;
234 int curl_fine = 0; 234 int curl_fine = 0;
235 while (NULL != (msg = curl_multi_info_read (multi, &pending))) 235 while (NULL != (msg = curl_multi_info_read (multi, &pending)))
236 { 236 {
237 if (msg->msg != CURLMSG_DONE) 237 if (msg->msg == CURLMSG_DONE)
238 { 238 {
239 if (msg->data.result != CURLE_OK) 239 if (msg->data.result == CURLE_OK)
240 curl_fine = 1;
241 else
242 {
240 fprintf (stderr, 243 fprintf (stderr,
241 "%s failed at %s:%d: `%s'\n", 244 "%s failed at %s:%d: `%s'\n",
242 "curl_multi_perform", 245 "curl_multi_perform",
243 __FILE__, 246 __FILE__,
244 __LINE__, curl_easy_strerror (msg->data.result)); 247 __LINE__, curl_easy_strerror (msg->data.result));
245 abort (); 248 abort ();
249 }
246 } 250 }
247 else
248 curl_fine = 1;
249 } 251 }
250 if (! curl_fine) 252 if (! curl_fine)
251 { 253 {