Skip to content

Commit 5c1c9b3

Browse files
committed
session BUGFIX timeout 0 means infinite
Fixes #459
1 parent 3392b4a commit 5c1c9b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/session.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ nc_send_hello_io(struct nc_session *session)
13711371
if (session->flags & NC_SESSION_CALLHOME) {
13721372
timeout_io = NC_SERVER_CH_HELLO_TIMEOUT * 1000;
13731373
} else {
1374-
timeout_io = server_opts.idle_timeout * 1000;
1374+
timeout_io = server_opts.idle_timeout ? server_opts.idle_timeout * 1000 : -1;
13751375
}
13761376
sid = &session->id;
13771377
}
@@ -1481,7 +1481,7 @@ nc_recv_server_hello_io(struct nc_session *session)
14811481
if (session->flags & NC_SESSION_CALLHOME) {
14821482
timeout_io = NC_SERVER_CH_HELLO_TIMEOUT * 1000;
14831483
} else {
1484-
timeout_io = server_opts.idle_timeout * 1000;
1484+
timeout_io = server_opts.idle_timeout ? server_opts.idle_timeout * 1000 : -1;
14851485
}
14861486

14871487
r = nc_read_msg_poll_io(session, timeout_io, &msg);

0 commit comments

Comments
 (0)