Fix Idle timer for listen mode, broken since -q option was added

This commit is contained in:
dmiller 2026-03-03 21:40:33 +00:00
parent 66fea77905
commit dd5eba48be

View file

@ -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;