libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit 9f8d5675a8d2c3f386f806c6ecc7fffcf40ecdbf
parent ec79acc64c2617081dbf26dddb48a27e88a6b9b9
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Wed, 24 Dec 2025 21:01:12 +0100

Re-used timeout initialisation function for resumed connections

Diffstat:
Msrc/mhd2/conn_timeout.c | 26--------------------------
Msrc/mhd2/conn_timeout.h | 9---------
Msrc/mhd2/events_process.c | 3++-
3 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/src/mhd2/conn_timeout.c b/src/mhd2/conn_timeout.c @@ -184,29 +184,3 @@ mhd_conn_update_activity_mark (struct MHD_Connection *restrict c) mhd_DLINKEDL_DEL_D (&(d->conns.def_timeout), c, by_timeout); mhd_DLINKEDL_INS_FIRST_D (&(d->conns.def_timeout), c, by_timeout); } - - -MHD_INTERNAL MHD_FN_PAR_NONNULL_ALL_ void -mhd_conn_resumed_activity_mark (struct MHD_Connection *restrict c) -{ - struct MHD_Daemon *const restrict d = c->daemon; -#if defined(MHD_SUPPORT_THREADS) - mhd_assert (! mhd_D_HAS_WORKERS (d)); -#endif /* MHD_SUPPORT_THREADS */ - - mhd_assert (! c->suspended); - mhd_assert (c->resuming); - - /* Update of activity for connections without timeout timer unless - * no timeout is set */ - if (0 != c->connection_timeout_ms) - c->last_activity = mhd_monotonic_msec_counter (); // TODO: Get and use time value one time per round - - if (mhd_D_HAS_THR_PER_CONN (d)) - return; /* each connection has personal timeout */ - - if (c->connection_timeout_ms == d->conns.cfg.timeout_milsec) - mhd_DLINKEDL_INS_FIRST_D (&(d->conns.def_timeout), c, by_timeout); - else - mhd_DLINKEDL_INS_FIRST_D (&(d->conns.cust_timeout), c, by_timeout); -} diff --git a/src/mhd2/conn_timeout.h b/src/mhd2/conn_timeout.h @@ -93,13 +93,4 @@ MHD_INTERNAL void mhd_conn_update_activity_mark (struct MHD_Connection *restrict c) MHD_FN_PAR_NONNULL_ALL_; - -/** - * Update last activity mark on the resumed connection - * @param c the connection to update - */ -MHD_INTERNAL void -mhd_conn_resumed_activity_mark (struct MHD_Connection *restrict c) -MHD_FN_PAR_NONNULL_ALL_; - #endif /* ! MHD_CONN_TIMEOUT_H */ diff --git a/src/mhd2/events_process.c b/src/mhd2/events_process.c @@ -241,7 +241,8 @@ start_resuming_connection (struct MHD_Connection *restrict c, (unsigned long long) c->sk.fd); #endif /* mhd_DEBUG_SUSPEND_RESUME */ c->suspended = false; - mhd_conn_resumed_activity_mark (c); + mhd_conn_init_activity_timeout (c, + (uint_fast32_t) c->connection_timeout_ms); mhd_conn_mark_ready (c, d); /* Force processing connection in this round */ }