diff options
Diffstat (limited to 'src/testcurl/test_get_response_cleanup.c')
-rw-r--r-- | src/testcurl/test_get_response_cleanup.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c index 0bb154c8..bdb83e2d 100644 --- a/src/testcurl/test_get_response_cleanup.c +++ b/src/testcurl/test_get_response_cleanup.c | |||
@@ -2,6 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | This file is part of libmicrohttpd | 3 | This file is part of libmicrohttpd |
4 | Copyright (C) 2007, 2009 Christian Grothoff | 4 | Copyright (C) 2007, 2009 Christian Grothoff |
5 | Copyright (C) 2014-2021 Evgeny Grin (Karlson2k) | ||
5 | 6 | ||
6 | libmicrohttpd is free software; you can redistribute it and/or modify | 7 | libmicrohttpd is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published | 8 | it under the terms of the GNU General Public License as published |
@@ -23,6 +24,7 @@ | |||
23 | * @file daemontest_get_response_cleanup.c | 24 | * @file daemontest_get_response_cleanup.c |
24 | * @brief Testcase for libmicrohttpd response cleanup | 25 | * @brief Testcase for libmicrohttpd response cleanup |
25 | * @author Christian Grothoff | 26 | * @author Christian Grothoff |
27 | * @author Karlson2k (Evgeny Grin) | ||
26 | */ | 28 | */ |
27 | 29 | ||
28 | #include "MHD_config.h" | 30 | #include "MHD_config.h" |
@@ -375,8 +377,25 @@ testExternalGet () | |||
375 | tv.tv_usec = 1000; | 377 | tv.tv_usec = 1000; |
376 | if (-1 == select (max + 1, &rs, &ws, &es, &tv)) | 378 | if (-1 == select (max + 1, &rs, &ws, &es, &tv)) |
377 | { | 379 | { |
380 | #ifdef MHD_POSIX_SOCKETS | ||
378 | if (EINTR != errno) | 381 | if (EINTR != errno) |
379 | abort (); | 382 | { |
383 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", | ||
384 | (int) errno, __LINE__); | ||
385 | fflush (stderr); | ||
386 | exit (99); | ||
387 | } | ||
388 | #else | ||
389 | if ((WSAEINVAL != WSAGetLastError ()) || | ||
390 | (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) | ||
391 | { | ||
392 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", | ||
393 | (int) WSAGetLastError (), __LINE__); | ||
394 | fflush (stderr); | ||
395 | exit (99); | ||
396 | } | ||
397 | Sleep (1); | ||
398 | #endif | ||
380 | } | 399 | } |
381 | MHD_run (d); | 400 | MHD_run (d); |
382 | } | 401 | } |
@@ -397,8 +416,25 @@ testExternalGet () | |||
397 | tv.tv_usec = 1000; | 416 | tv.tv_usec = 1000; |
398 | if (-1 == select (max + 1, &rs, &ws, &es, &tv)) | 417 | if (-1 == select (max + 1, &rs, &ws, &es, &tv)) |
399 | { | 418 | { |
419 | #ifdef MHD_POSIX_SOCKETS | ||
400 | if (EINTR != errno) | 420 | if (EINTR != errno) |
401 | abort (); | 421 | { |
422 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", | ||
423 | (int) errno, __LINE__); | ||
424 | fflush (stderr); | ||
425 | exit (99); | ||
426 | } | ||
427 | #else | ||
428 | if ((WSAEINVAL != WSAGetLastError ()) || | ||
429 | (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) | ||
430 | { | ||
431 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", | ||
432 | (int) WSAGetLastError (), __LINE__); | ||
433 | fflush (stderr); | ||
434 | exit (99); | ||
435 | } | ||
436 | Sleep (1); | ||
437 | #endif | ||
402 | } | 438 | } |
403 | MHD_run (d); | 439 | MHD_run (d); |
404 | } | 440 | } |