libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit f5d7b2fc925e4ba7c2268cb77b754a2fe19d5f13
parent b44b4f73dd5e3920983f885722a4b7a572b41e10
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Sat, 22 Oct 2022 18:49:38 +0300

test_head: check libcurl for timeout value

Diffstat:
Msrc/testcurl/test_head.c | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/testcurl/test_head.c b/src/testcurl/test_head.c @@ -612,6 +612,15 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c, CURLM **multi_reuse) mhdErrorExitDesc ("MHD_get_fdset() failed"); tv.tv_sec = 0; tv.tv_usec = 200000; + if (0 == MHD_get_timeout64s (d)) + tv.tv_usec = 0; + else + { + long curl_to = -1; + curl_multi_timeout (multi, &curl_to); + if (0 == curl_to) + tv.tv_usec = 0; + } #ifdef MHD_POSIX_SOCKETS if (maxMhdSk > maxCurlSk) maxCurlSk = maxMhdSk; @@ -625,7 +634,7 @@ performQueryExternal (struct MHD_Daemon *d, CURL *c, CURLM **multi_reuse) if ((WSAEINVAL != WSAGetLastError ()) || (0 != rs.fd_count) || (0 != ws.fd_count) || (0 != es.fd_count) ) externalErrorExitDesc ("Unexpected select() error"); - Sleep (200); + Sleep ((unsigned long) tv.tv_usec / 1000); #endif } if (MHD_YES != MHD_run_from_select (d, &rs, &ws, &es))