diff options
Diffstat (limited to 'src/testcurl/test_get_sendfile.c')
-rw-r--r-- | src/testcurl/test_get_sendfile.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c index 36f29b27..8db2c3aa 100644 --- a/src/testcurl/test_get_sendfile.c +++ b/src/testcurl/test_get_sendfile.c | |||
@@ -276,7 +276,12 @@ testExternalGet () | |||
276 | fd_set rs; | 276 | fd_set rs; |
277 | fd_set ws; | 277 | fd_set ws; |
278 | fd_set es; | 278 | fd_set es; |
279 | MHD_socket max; | 279 | MHD_socket maxsock; |
280 | #ifdef MHD_WINSOCK_SOCKETS | ||
281 | int maxposixs; /* Max socket number unused on W32 */ | ||
282 | #else /* MHD_POSIX_SOCKETS */ | ||
283 | #define maxposixs maxsock | ||
284 | #endif /* MHD_POSIX_SOCKETS */ | ||
280 | int running; | 285 | int running; |
281 | struct CURLMsg *msg; | 286 | struct CURLMsg *msg; |
282 | time_t start; | 287 | time_t start; |
@@ -325,12 +330,13 @@ testExternalGet () | |||
325 | start = time (NULL); | 330 | start = time (NULL); |
326 | while ((time (NULL) - start < 5) && (multi != NULL)) | 331 | while ((time (NULL) - start < 5) && (multi != NULL)) |
327 | { | 332 | { |
328 | max = 0; | 333 | maxsock = MHD_INVALID_SOCKET; |
334 | maxposixs = -1; | ||
329 | FD_ZERO (&rs); | 335 | FD_ZERO (&rs); |
330 | FD_ZERO (&ws); | 336 | FD_ZERO (&ws); |
331 | FD_ZERO (&es); | 337 | FD_ZERO (&es); |
332 | curl_multi_perform (multi, &running); | 338 | curl_multi_perform (multi, &running); |
333 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 339 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &maxposixs); |
334 | if (mret != CURLM_OK) | 340 | if (mret != CURLM_OK) |
335 | { | 341 | { |
336 | curl_multi_remove_handle (multi, c); | 342 | curl_multi_remove_handle (multi, c); |
@@ -339,7 +345,7 @@ testExternalGet () | |||
339 | MHD_stop_daemon (d); | 345 | MHD_stop_daemon (d); |
340 | return 2048; | 346 | return 2048; |
341 | } | 347 | } |
342 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &max)) | 348 | if (MHD_YES != MHD_get_fdset (d, &rs, &ws, &es, &maxsock)) |
343 | { | 349 | { |
344 | curl_multi_remove_handle (multi, c); | 350 | curl_multi_remove_handle (multi, c); |
345 | curl_multi_cleanup (multi); | 351 | curl_multi_cleanup (multi); |
@@ -349,7 +355,7 @@ testExternalGet () | |||
349 | } | 355 | } |
350 | tv.tv_sec = 0; | 356 | tv.tv_sec = 0; |
351 | tv.tv_usec = 1000; | 357 | tv.tv_usec = 1000; |
352 | select (max + 1, &rs, &ws, &es, &tv); | 358 | select (maxposixs + 1, &rs, &ws, &es, &tv); |
353 | curl_multi_perform (multi, &running); | 359 | curl_multi_perform (multi, &running); |
354 | if (running == 0) | 360 | if (running == 0) |
355 | { | 361 | { |