Skip to content

Commit b67a1d6

Browse files
RESPONDER: fixed an issue with 'client_idle_timer'
As it was implemented previously, effective period was 1.5*client_idle_timeout instead of `client_idle_timeout` as documented. Log with default value - 60 - before a fix: ``` (:49:12): [nss] [setup_client_idle_timer] (0x4000): Idle timer re-set for client [0x557af16f31b0][22] (:49:42): [nss] [setup_client_idle_timer] (0x4000): Idle timer re-set for client [0x557af16f31b0][22] (:50:12): [nss] [setup_client_idle_timer] (0x4000): Idle timer re-set for client [0x557af16f31b0][22] (:50:42): [nss] [client_idle_handler] (0x2000): Terminating idle client [0x557af16f31b0][22] ```
1 parent 6579a48 commit b67a1d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/responder/common/responder_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ static void client_idle_handler(struct tevent_context *ev,
653653
goto done;
654654
}
655655

656-
if ((now - cctx->last_request_time) > cctx->rctx->client_idle_timeout) {
656+
if ((now - cctx->last_request_time) >= cctx->rctx->client_idle_timeout) {
657657
/* This connection is idle. Terminate it */
658658
DEBUG(SSSDBG_TRACE_INTERNAL,
659659
"Terminating idle client [%p][%d]\n",
@@ -678,7 +678,7 @@ errno_t reset_client_idle_timer(struct cli_ctx *cctx)
678678
static errno_t setup_client_idle_timer(struct cli_ctx *cctx)
679679
{
680680
struct timeval tv =
681-
tevent_timeval_current_ofs(cctx->rctx->client_idle_timeout/2, 0);
681+
tevent_timeval_current_ofs(cctx->rctx->client_idle_timeout/2 + 1, 0);
682682

683683
talloc_zfree(cctx->idle);
684684

0 commit comments

Comments
 (0)