aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_get_chunked.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/test_get_chunked.c')
-rw-r--r--src/testcurl/test_get_chunked.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index 6efe2f5e..003b6a58 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -291,7 +291,12 @@ testExternalGet ()
291 fd_set rs; 291 fd_set rs;
292 fd_set ws; 292 fd_set ws;
293 fd_set es; 293 fd_set es;
294 MHD_socket max; 294 MHD_socket maxsock;
295#ifdef MHD_WINSOCK_SOCKETS
296 int maxposixs; /* Max socket number unused on W32 */
297#else /* MHD_POSIX_SOCKETS */
298#define maxposixs maxsock
299#endif /* MHD_POSIX_SOCKETS */
295 int running; 300 int running;
296 struct CURLMsg *msg; 301 struct CURLMsg *msg;
297 time_t start; 302 time_t start;
@@ -337,12 +342,13 @@ testExternalGet ()
337 start = time (NULL); 342 start = time (NULL);
338 while ((time (NULL) - start < 5) && (multi != NULL)) 343 while ((time (NULL) - start < 5) && (multi != NULL))
339 { 344 {
340 max = 0; 345 maxsock = MHD_INVALID_SOCKET;
346 maxposixs = -1;
341 FD_ZERO (&rs); 347 FD_ZERO (&rs);
342 FD_ZERO (&ws); 348 FD_ZERO (&ws);
343 FD_ZERO (&es); 349 FD_ZERO (&es);
344 curl_multi_perform (multi, &running); 350 curl_multi_perform (multi, &running);
345 mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); 351 mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs);
346 if (mret != CURLM_OK) 352 if (mret != CURLM_OK)
347 { 353 {
348 curl_multi_remove_handle (multi, c); 354 curl_multi_remove_handle (multi, c);
@@ -351,7 +357,7 @@ testExternalGet ()
351 MHD_stop_daemon (d); 357 MHD_stop_daemon (d);
352 return 2048; 358 return 2048;
353 } 359 }
354 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) 360 if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock))
355 { 361 {
356 curl_multi_remove_handle (multi, c); 362 curl_multi_remove_handle (multi, c);
357 curl_multi_cleanup (multi); 363 curl_multi_cleanup (multi);
@@ -361,7 +367,7 @@ testExternalGet ()
361 } 367 }
362 tv.tv_sec = 0; 368 tv.tv_sec = 0;
363 tv.tv_usec = 1000; 369 tv.tv_usec = 1000;
364 select (max + 1, &rs, &ws, &es, &tv); 370 select (maxposixs + 1, &rs, &ws, &es, &tv);
365 curl_multi_perform (multi, &running); 371 curl_multi_perform (multi, &running);
366 if (running == 0) 372 if (running == 0)
367 { 373 {