From dd5eba48be291a3d281a29cd1fce4fabb6cd62c3 Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 3 Mar 2026 21:40:33 +0000 Subject: [PATCH] Fix Idle timer for listen mode, broken since -q option was added --- ncat/ncat_listen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ncat/ncat_listen.c b/ncat/ncat_listen.c index 644555963..0081446a4 100644 --- a/ncat/ncat_listen.c +++ b/ncat/ncat_listen.c @@ -322,8 +322,10 @@ int ncat_listen() } /* The idle timer should only be running when there are active connections */ - if (o.idletimeout > 0 && get_conn_count() && o.idletimeout * 1000 < usec_wait) + if (o.idletimeout > 0 && get_conn_count()) { + if (usec_wait < 0 || o.idletimeout * 1000 < usec_wait) usec_wait = o.idletimeout * 1000; + } if (usec_wait >= 0) { tvp = &tv;