diff options
author | Jakub Jelen <jjelen@redhat.com> | 2019-09-17 16:38:05 +0200 |
---|---|---|
committer | Anderson Toshiyuki Sasaki <ansasaki@redhat.com> | 2019-09-30 15:59:53 +0200 |
commit | 93541fe150e90cdb366aad734961914374a9f609 (patch) | |
tree | 2b2de4f6daccc2eb6d15cafc5663520d4078fa0b | |
parent | e6ba98a0aa9554396b50be9efa39837c808f2cc1 (diff) | |
download | libssh-93541fe150e90cdb366aad734961914374a9f609.tar.gz libssh-93541fe150e90cdb366aad734961914374a9f609.tar.xz libssh-93541fe150e90cdb366aad734961914374a9f609.zip |
channels: Correctly reports failed channels opening
Fixes T75
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit 2f05243a4a7b4729c0e2d9a92b11c54d561551d2)
-rw-r--r-- | src/channels.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |