diff options
Diffstat (limited to 'src/testcurl/test_post_loop.c')
-rw-r--r-- | src/testcurl/test_post_loop.c | 16 |
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 () fd_set rs; fd_set ws; fd_set es; - MHD_socket max; + MHD_socket maxsock; +#ifdef MHD_WINSOCK_SOCKETS + int maxposixs; /* Max socket number unused on W32 */ +#else /* MHD_POSIX_SOCKETS */ +#define maxposixs maxsock +#endif /* MHD_POSIX_SOCKETS */ int running; struct CURLMsg *msg; time_t start; @@ -371,13 +376,14 @@ testExternalPost () start = time (NULL); while ((time (NULL) - start < 5) && (multi != NULL)) { - max = 0; + maxsock = MHD_INVALID_SOCKET; + maxposixs = -1; FD_ZERO (&rs); FD_ZERO (&ws); FD_ZERO (&es); while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform (multi, &running)); - mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); + mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs); if (mret != CURLM_OK) { curl_multi_remove_handle (multi, c); @@ -386,7 +392,7 @@ testExternalPost () MHD_stop_daemon (d); return 2048; } - if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) + if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock)) { curl_multi_remove_handle (multi, c); curl_multi_cleanup (multi); @@ -403,7 +409,7 @@ testExternalPost () timeout = 0; /* terminate quickly... */ tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout % 1000) * 1000; - if (-1 == select (max + 1, &rs, &ws, &es, &tv)) + if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv)) { if (EINTR == errno) continue; |