diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-18 12:00:29 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-08-18 12:48:46 +0300 |
commit | 0c3806b05804d668f3a88853f90e930bc180b10e (patch) | |
tree | 9f4e3bc80fe515ed2c91505e608fbc285ead9b7e /src/testcurl/test_process_arguments.c | |
parent | ebd43f0373e3b62bf25213b5cd20a84e09c010e3 (diff) | |
download | libmicrohttpd-0c3806b05804d668f3a88853f90e930bc180b10e.tar.gz libmicrohttpd-0c3806b05804d668f3a88853f90e930bc180b10e.zip |
curl tests: updated select() error handling, file doxy
Tests reports now about unexpected errors from select() and
source code line number to simplify problematic position
locating.
Used much smaller timeout on W32 if system is doing some
sockets data processing in other threads.
Diffstat (limited to 'src/testcurl/test_process_arguments.c')
-rw-r--r-- | src/testcurl/test_process_arguments.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/testcurl/test_process_arguments.c b/src/testcurl/test_process_arguments.c index 96a46e1d..a7aecf88 100644 --- a/src/testcurl/test_process_arguments.c +++ b/src/testcurl/test_process_arguments.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2007, 2013 Christian Grothoff | 3 | Copyright (C) 2007, 2013 Christian Grothoff |
4 | Copyright (C) 2014-2021 Evgeny Grin (Karlson2k) | ||
4 | 5 | ||
5 | libmicrohttpd is free software; you can redistribute it and/or modify | 6 | libmicrohttpd is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 7 | it under the terms of the GNU General Public License as published |
@@ -22,6 +23,7 @@ | |||
22 | * @file test_process_arguments.c | 23 | * @file test_process_arguments.c |
23 | * @brief Testcase for HTTP URI arguments | 24 | * @brief Testcase for HTTP URI arguments |
24 | * @author Christian Grothoff | 25 | * @author Christian Grothoff |
26 | * @author Karlson2k (Evgeny Grin) | ||
25 | */ | 27 | */ |
26 | 28 | ||
27 | #include "MHD_config.h" | 29 | #include "MHD_config.h" |
@@ -227,14 +229,22 @@ testExternalGet () | |||
227 | { | 229 | { |
228 | #ifdef MHD_POSIX_SOCKETS | 230 | #ifdef MHD_POSIX_SOCKETS |
229 | if (EINTR != errno) | 231 | if (EINTR != errno) |
230 | abort (); | 232 | { |
233 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", | ||
234 | (int) errno, __LINE__); | ||
235 | fflush (stderr); | ||
236 | exit (99); | ||
237 | } | ||
231 | #else | 238 | #else |
232 | if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 != | 239 | if ((WSAEINVAL != WSAGetLastError ()) || |
233 | ws. | 240 | (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) |
234 | fd_count) | 241 | { |
235 | || (0 != es.fd_count) ) | 242 | fprintf (stderr, "Unexpected select() error: %d. Line: %d\n", |
236 | abort (); | 243 | (int) WSAGetLastError (), __LINE__); |
237 | Sleep (1000); | 244 | fflush (stderr); |
245 | exit (99); | ||
246 | } | ||
247 | Sleep (1); | ||
238 | #endif | 248 | #endif |
239 | } | 249 | } |
240 | curl_multi_perform (multi, &running); | 250 | curl_multi_perform (multi, &running); |