1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

session: Handle session state in ssh_get_status().

BUG: https://red.libssh.org/issues/109
This commit is contained in:
Andreas Schneider
2013-07-25 22:27:56 +02:00
parent cdf193d8b5
commit f9b8395122

View File

@@ -586,7 +586,8 @@ int ssh_get_status(ssh_session session) {
if (socketstate & SSH_WRITE_PENDING) {
r |= SSH_WRITE_PENDING;
}
if (session->closed && (socketstate & SSH_CLOSED_ERROR)) {
if (session->closed && (socketstate & SSH_CLOSED_ERROR) ||
session->session_state == SSH_SESSION_STATE_ERROR) {
r |= SSH_CLOSED_ERROR;
}