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 2f05243a4a)
This commit is contained in:
Jakub Jelen
2019-09-17 16:38:05 +02:00
committed by Anderson Toshiyuki Sasaki
parent e6ba98a0aa
commit 93541fe150

View File

@@ -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;