aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/test_process_headers.c
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-18 12:00:29 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-18 12:48:46 +0300
commit0c3806b05804d668f3a88853f90e930bc180b10e (patch)
tree9f4e3bc80fe515ed2c91505e608fbc285ead9b7e /src/testcurl/test_process_headers.c
parentebd43f0373e3b62bf25213b5cd20a84e09c010e3 (diff)
downloadlibmicrohttpd-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_headers.c')
-rw-r--r--src/testcurl/test_process_headers.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index b0826b3d..e7e8897e 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.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 Christian Grothoff 3 Copyright (C) 2007 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_headers.c 23 * @file test_process_headers.c
23 * @brief Testcase for HTTP header access 24 * @brief Testcase for HTTP header access
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"
@@ -483,14 +485,22 @@ testExternalGet ()
483 { 485 {
484#ifdef MHD_POSIX_SOCKETS 486#ifdef MHD_POSIX_SOCKETS
485 if (EINTR != errno) 487 if (EINTR != errno)
486 abort (); 488 {
489 fprintf (stderr, "Unexpected select() error: %d. Line: %d\n",
490 (int) errno, __LINE__);
491 fflush (stderr);
492 exit (99);
493 }
487#else 494#else
488 if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 != 495 if ((WSAEINVAL != WSAGetLastError ()) ||
489 ws. 496 (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) )
490 fd_count) 497 {
491 || (0 != es.fd_count) ) 498 fprintf (stderr, "Unexpected select() error: %d. Line: %d\n",
492 abort (); 499 (int) WSAGetLastError (), __LINE__);
493 Sleep (1000); 500 fflush (stderr);
501 exit (99);
502 }
503 Sleep (1);
494#endif 504#endif
495 } 505 }
496 curl_multi_perform (multi, &running); 506 curl_multi_perform (multi, &running);