diff options
Diffstat (limited to 'src/testcurl/test_post.c')
-rw-r--r-- | src/testcurl/test_post.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c index ad44791f..49074bf3 100644 --- a/src/testcurl/test_post.c +++ b/src/testcurl/test_post.c | |||
@@ -333,7 +333,12 @@ testExternalPost () | |||
333 | fd_set rs; | 333 | fd_set rs; |
334 | fd_set ws; | 334 | fd_set ws; |
335 | fd_set es; | 335 | fd_set es; |
336 | MHD_socket max; | 336 | MHD_socket maxsock; |
337 | #ifdef MHD_WINSOCK_SOCKETS | ||
338 | int maxposixs; /* Max socket number unused on W32 */ | ||
339 | #else /* MHD_POSIX_SOCKETS */ | ||
340 | #define maxposixs maxsock | ||
341 | #endif /* MHD_POSIX_SOCKETS */ | ||
337 | int running; | 342 | int running; |
338 | struct CURLMsg *msg; | 343 | struct CURLMsg *msg; |
339 | time_t start; | 344 | time_t start; |
@@ -387,12 +392,13 @@ testExternalPost () | |||
387 | start = time (NULL); | 392 | start = time (NULL); |
388 | while ((time (NULL) - start < 5) && (multi != NULL)) | 393 | while ((time (NULL) - start < 5) && (multi != NULL)) |
389 | { | 394 | { |
390 | max = 0; | 395 | maxsock = MHD_INVALID_SOCKET; |
396 | maxposixs = -1; | ||
391 | FD_ZERO (&rs); | 397 | FD_ZERO (&rs); |
392 | FD_ZERO (&ws); | 398 | FD_ZERO (&ws); |
393 | FD_ZERO (&es); | 399 | FD_ZERO (&es); |
394 | curl_multi_perform (multi, &running); | 400 | curl_multi_perform (multi, &running); |
395 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 401 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs); |
396 | if (mret != CURLM_OK) | 402 | if (mret != CURLM_OK) |
397 | { | 403 | { |
398 | curl_multi_remove_handle (multi, c); | 404 | curl_multi_remove_handle (multi, c); |
@@ -401,7 +407,7 @@ testExternalPost () | |||
401 | MHD_stop_daemon (d); | 407 | MHD_stop_daemon (d); |
402 | return 2048; | 408 | return 2048; |
403 | } | 409 | } |
404 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) | 410 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock)) |
405 | { | 411 | { |
406 | curl_multi_remove_handle (multi, c); | 412 | curl_multi_remove_handle (multi, c); |
407 | curl_multi_cleanup (multi); | 413 | curl_multi_cleanup (multi); |
@@ -411,7 +417,7 @@ testExternalPost () | |||
411 | } | 417 | } |
412 | tv.tv_sec = 0; | 418 | tv.tv_sec = 0; |
413 | tv.tv_usec = 1000; | 419 | tv.tv_usec = 1000; |
414 | select (max + 1, &rs, &ws, &es, &tv); | 420 | select (maxposixs + 1, &rs, &ws, &es, &tv); |
415 | curl_multi_perform (multi, &running); | 421 | curl_multi_perform (multi, &running); |
416 | if (running == 0) | 422 | if (running == 0) |
417 | { | 423 | { |