Skip to content

Commit

Permalink
session BUGFIX timeout 0 means infinite
Browse files Browse the repository at this point in the history
Fixes #459
  • Loading branch information
michalvasko committed Feb 2, 2024
1 parent 3392b4a commit 5c1c9b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ nc_send_hello_io(struct nc_session *session)
if (session->flags & NC_SESSION_CALLHOME) {
timeout_io = NC_SERVER_CH_HELLO_TIMEOUT * 1000;
} else {
timeout_io = server_opts.idle_timeout * 1000;
timeout_io = server_opts.idle_timeout ? server_opts.idle_timeout * 1000 : -1;
}
sid = &session->id;
}
Expand Down Expand Up @@ -1481,7 +1481,7 @@ nc_recv_server_hello_io(struct nc_session *session)
if (session->flags & NC_SESSION_CALLHOME) {
timeout_io = NC_SERVER_CH_HELLO_TIMEOUT * 1000;
} else {
timeout_io = server_opts.idle_timeout * 1000;
timeout_io = server_opts.idle_timeout ? server_opts.idle_timeout * 1000 : -1;
}

r = nc_read_msg_poll_io(session, timeout_io, &msg);
Expand Down

0 comments on commit 5c1c9b3

Please sign in to comment.