From 2f05243a4a7b4729c0e2d9a92b11c54d561551d2 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 17 Sep 2019 16:38:05 +0200 Subject: channels: Correctly reports failed channels opening Fixes T75 Signed-off-by: Jakub Jelen Reviewed-by: Anderson Toshiyuki Sasaki --- src/channels.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/channels.c b/src/channels.c index 74aef62c..23666137 100644 --- a/src/channels.c +++ b/src/channels.c @@ -350,8 +350,13 @@ pending: } end: + /* This needs to pass the SSH_AGAIN from the above, + * but needs to catch failed channel states */ if (channel->state == SSH_CHANNEL_STATE_OPEN) { err = SSH_OK; + } else if (err != SSH_AGAIN) { + /* Messages were handled correctly, but he channel state is invalid */ + err = SSH_ERROR; } return err; -- cgit v1.2.3