From 44cc3bb57ca8c4445d9901134418d7bee1275615 Mon Sep 17 00:00:00 2001 From: KingToolbox Date: Thu, 11 Mar 2021 23:20:16 +0800 Subject: [PATCH] The timeout was not handled properly when processing the packet. --- src/libssh/src/channels.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libssh/src/channels.c b/src/libssh/src/channels.c index 4eea885..0a5f53d 100644 --- a/src/libssh/src/channels.c +++ b/src/libssh/src/channels.c @@ -2922,6 +2922,12 @@ int ssh_channel_read_timeout(ssh_channel channel, timeout_ms, ssh_channel_read_termination, &ctx); + + if (rc == SSH_AGAIN && ssh_is_blocking(session)) { + ssh_set_error(session, SSH_FATAL, "Handle packets timeout."); + return rc; + } + if (rc == SSH_ERROR){ return rc; }