commit b4f5a1cb8db43c3df5bb351fef48a108428e64d0
parent dbda6df50c6f3338854ddb70318b29b9705407ee
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Fri, 26 Dec 2025 11:39:48 +0100
Connection timeouts: do not manupulate timeouts lists when timeout not used
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/mhd2/conn_timeout.c b/src/mhd2/conn_timeout.c
@@ -118,8 +118,10 @@ mhd_conn_init_activity_timeout (struct MHD_Connection *restrict c,
c->timeout.milsec = timeout;
- if (0 != timeout)
- c->timeout.last_act = mhd_monotonic_msec_counter (); // TODO: Get and use time value one time per round
+ if (0u == timeout)
+ return;
+
+ c->timeout.last_act = mhd_monotonic_msec_counter (); // TODO: Get and use time value one time per round
if (mhd_D_HAS_THR_PER_CONN (d))
return;
@@ -145,6 +147,9 @@ mhd_conn_deinit_activity_timeout (struct MHD_Connection *restrict c)
mhd_assert (! mhd_D_HAS_WORKERS (d));
#endif /* MHD_SUPPORT_THREADS */
+ if (0u == c->timeout.milsec)
+ return;
+
if (mhd_D_HAS_THR_PER_CONN (d))
return;
@@ -169,9 +174,8 @@ mhd_conn_update_activity_mark (struct MHD_Connection *restrict c)
mhd_assert (! c->suspended);
- if (0 == c->timeout.milsec)
- return; /* Skip update of activity for connections
- without timeout timer. */
+ if (0u == c->timeout.milsec)
+ return;
c->timeout.last_act = mhd_monotonic_msec_counter (); // TODO: Get and use time value one time per round
if (mhd_D_HAS_THR_PER_CONN (d))