aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_post_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_post_loop.c')
-rw-r--r--src/testcurl/test_post_loop.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index 4fd632f5..0dad0153 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -311,7 +311,12 @@ testExternalPost ()
311 fd_set rs; 311 fd_set rs;
312 fd_set ws; 312 fd_set ws;
313 fd_set es; 313 fd_set es;
314 MHD_socket max; 314 MHD_socket maxsock;
315#ifdef MHD_WINSOCK_SOCKETS
316 int maxposixs; /* Max socket number unused on W32 */
317#else /* MHD_POSIX_SOCKETS */
318#define maxposixs maxsock
319#endif /* MHD_POSIX_SOCKETS */
315 int running; 320 int running;
316 struct CURLMsg *msg; 321 struct CURLMsg *msg;
317 time_t start; 322 time_t start;
@@ -371,13 +376,14 @@ testExternalPost ()
371 start = time (NULL); 376 start = time (NULL);
372 while ((time (NULL) - start < 5) && (multi != NULL)) 377 while ((time (NULL) - start < 5) && (multi != NULL))
373 { 378 {
374 max = 0; 379 maxsock = MHD_INVALID_SOCKET;
380 maxposixs = -1;
375 FD_ZERO (&rs); 381 FD_ZERO (&rs);
376 FD_ZERO (&ws); 382 FD_ZERO (&ws);
377 FD_ZERO (&es); 383 FD_ZERO (&es);
378 while (CURLM_CALL_MULTI_PERFORM == 384 while (CURLM_CALL_MULTI_PERFORM ==
379 curl_multi_perform (multi, &running)); 385 curl_multi_perform (multi, &running));
380 mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); 386 mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
381 if (mret != CURLM_OK) 387 if (mret != CURLM_OK)
382 { 388 {
383 curl_multi_remove_handle (multi, c); 389 curl_multi_remove_handle (multi, c);
@@ -386,7 +392,7 @@ testExternalPost ()
386 MHD_stop_daemon (d); 392 MHD_stop_daemon (d);
387 return 2048; 393 return 2048;
388 } 394 }
389 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) 395 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
390 { 396 {
391 curl_multi_remove_handle (multi, c); 397 curl_multi_remove_handle (multi, c);
392 curl_multi_cleanup (multi); 398 curl_multi_cleanup (multi);
@@ -403,7 +409,7 @@ testExternalPost ()
403 timeout = 0; /* terminate quickly... */ 409 timeout = 0; /* terminate quickly... */
404 tv.tv_sec = timeout / 1000; 410 tv.tv_sec = timeout / 1000;
405 tv.tv_usec = (timeout % 1000) * 1000; 411 tv.tv_usec = (timeout % 1000) * 1000;
406 if (-1 == select (max + 1, &rs, &ws, &es, &tv)) 412 if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
407 { 413 {
408 if (EINTR == errno) 414 if (EINTR == errno)
409 continue; 415 continue;