aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-09-17 16:38:05 +0200
committerJakub Jelen <jjelen@redhat.com>2019-09-24 16:04:52 +0200
commit2f05243a4a7b4729c0e2d9a92b11c54d561551d2 (patch)
treedb74679c2ecac0bb07f83f9577d953adfc64af61
parent89a9eb8811da56095a56a82d7967e01fdbdc7d27 (diff)
downloadlibssh-2f05243a4a7b4729c0e2d9a92b11c54d561551d2.tar.gz
libssh-2f05243a4a7b4729c0e2d9a92b11c54d561551d2.tar.xz
libssh-2f05243a4a7b4729c0e2d9a92b11c54d561551d2.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>
-rw-r--r--src/channels.c5
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;