commit 951af313d49927ece3c5432aa8fe12129a28b7a0
parent d7b94f72f9ccb6d679cf6ed3e5028b4c7129edcc
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Wed, 24 Dec 2025 20:25:18 +0100
Missing part for: Renamed daemon timeout option and info type: use milliseconds instead of seconds,
moved timeout-related functions to special file
Diffstat:
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/tests/client_server/libtest.c b/src/tests/client_server/libtest.c
@@ -377,6 +377,7 @@ run_client_phase (const struct MHDT_Phase *phase,
pthread_t clients[num_clients];
int p[2];
unsigned int i;
+ uint_fast32_t te;
bool ret = true;
make_pipe (p);
@@ -401,7 +402,7 @@ run_client_phase (const struct MHDT_Phase *phase,
/* 0 for timeout_ms means no timeout, we deliberately
underflow to MAX_UINT in this case... */
- for (i = phase->timeout_ms - 1; i>0; i--)
+ for (te = phase->timeout_ms - 1; te>0; te--)
{
struct timespec ms = {
.tv_nsec = 1000 * 1000
@@ -415,7 +416,7 @@ run_client_phase (const struct MHDT_Phase *phase,
fprintf (stderr,
"nanosleep() interrupted (%s), trying again\n",
strerror (errno));
- i++;
+ te++;
}
/* This is a non-blocking read */
while (1 == read (p[0],
@@ -428,8 +429,8 @@ run_client_phase (const struct MHDT_Phase *phase,
if (0 != clients_left)
{
fprintf (stderr,
- "Timeout (%u ms) in phase '%s': %u clients still running\n",
- phase->timeout_ms,
+ "Timeout (%lu ms) in phase '%s': %u clients still running\n",
+ (unsigned long) phase->timeout_ms,
phase->label,
clients_left);
exit (1);
diff --git a/src/tests/client_server/libtest_convenience.c b/src/tests/client_server/libtest_convenience.c
@@ -99,7 +99,7 @@ MHDT_server_setup_minimal (const void *cls,
if (MHD_SC_OK !=
MHD_DAEMON_SET_OPTIONS (
d,
- MHD_D_OPTION_DEFAULT_TIMEOUT (1),
+ MHD_D_OPTION_DEFAULT_TIMEOUT_MILSEC (2000),
MHD_D_OPTION_BIND_PORT (MHD_AF_AUTO,
get_port ())))
return "Failed to bind to port!";
@@ -424,7 +424,7 @@ MHDT_server_setup_external (const void *cls,
if (MHD_SC_OK !=
MHD_DAEMON_SET_OPTIONS (
d,
- MHD_D_OPTION_DEFAULT_TIMEOUT (1),
+ MHD_D_OPTION_DEFAULT_TIMEOUT_MILSEC (2000),
MHD_D_OPTION_BIND_PORT (MHD_AF_AUTO,
get_port ())))
return "Failed to bind to port 0!";