aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_postform.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_postform.c')
-rw-r--r--src/testcurl/test_postform.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index 58b93b72..e45b3131 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -351,7 +351,12 @@ testExternalPost ()
351 fd_set rs; 351 fd_set rs;
352 fd_set ws; 352 fd_set ws;
353 fd_set es; 353 fd_set es;
354 MHD_socket max; 354 MHD_socket maxsock;
355#ifdef MHD_WINSOCK_SOCKETS
356 int maxposixs; /* Max socket number unused on W32 */
357#else /* MHD_POSIX_SOCKETS */
358#define maxposixs maxsock
359#endif /* MHD_POSIX_SOCKETS */
355 int running; 360 int running;
356 struct CURLMsg *msg; 361 struct CURLMsg *msg;
357 time_t start; 362 time_t start;
@@ -407,12 +412,13 @@ testExternalPost ()
407 start = time (NULL); 412 start = time (NULL);
408 while ((time (NULL) - start < 5) && (multi != NULL)) 413 while ((time (NULL) - start < 5) && (multi != NULL))
409 { 414 {
410 max = 0; 415 maxsock = MHD_INVALID_SOCKET;
416 maxposixs = -1;
411 FD_ZERO (&rs); 417 FD_ZERO (&rs);
412 FD_ZERO (&ws); 418 FD_ZERO (&ws);
413 FD_ZERO (&es); 419 FD_ZERO (&es);
414 curl_multi_perform (multi, &running); 420 curl_multi_perform (multi, &running);
415 mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); 421 mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
416 if (mret != CURLM_OK) 422 if (mret != CURLM_OK)
417 { 423 {
418 curl_multi_remove_handle (multi, c); 424 curl_multi_remove_handle (multi, c);
@@ -422,7 +428,7 @@ testExternalPost ()
422 curl_formfree (pd); 428 curl_formfree (pd);
423 return 2048; 429 return 2048;
424 } 430 }
425 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) 431 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
426 { 432 {
427 curl_multi_remove_handle (multi, c); 433 curl_multi_remove_handle (multi, c);
428 curl_multi_cleanup (multi); 434 curl_multi_cleanup (multi);
@@ -433,7 +439,7 @@ testExternalPost ()
433 } 439 }
434 tv.tv_sec = 0; 440 tv.tv_sec = 0;
435 tv.tv_usec = 1000; 441 tv.tv_usec = 1000;
436 select (max + 1, &rs, &ws, &es, &tv); 442 select (maxposixs + 1, &rs, &ws, &es, &tv);
437 curl_multi_perform (multi, &running); 443 curl_multi_perform (multi, &running);
438 if (running == 0) 444 if (running == 0)
439 { 445 {