session: Check the session timeout and use it if set

This checks if a timeout has been set using ssh_options_set(). If it has
been set it will use that parametr by default for blocking sessions.

This is at least what users are expecting.

Fixes T33

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-11-20 09:32:23 +01:00
parent 8ece2abfab
commit e4e51ccc13
2 changed files with 26 additions and 20 deletions

View File

@@ -2751,7 +2751,7 @@ int ssh_channel_read_timeout(ssh_channel channel,
ctx.buffer = stdbuf;
ctx.count = 1;
if (timeout_ms < 0) {
if (timeout_ms < SSH_TIMEOUT_DEFAULT) {
timeout_ms = SSH_TIMEOUT_INFINITE;
}