mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 10:40:28 +09:00
channel: check for closed state in waitwindow loops
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit dee8e5688b)
This commit is contained in:
committed by
Andreas Schneider
parent
7f18ec4620
commit
2091dab273
@@ -1238,7 +1238,8 @@ error:
|
||||
static int ssh_channel_waitwindow_termination(void *c){
|
||||
ssh_channel channel = (ssh_channel) c;
|
||||
if (channel->remote_window > 0 ||
|
||||
channel->session->session_state == SSH_SESSION_STATE_ERROR)
|
||||
channel->session->session_state == SSH_SESSION_STATE_ERROR ||
|
||||
channel->state == SSH_CHANNEL_STATE_CLOSED)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -1345,7 +1346,8 @@ int channel_write_common(ssh_channel channel, const void *data,
|
||||
ssh_channel_waitwindow_termination,channel);
|
||||
if (rc == SSH_ERROR ||
|
||||
!ssh_channel_waitwindow_termination(channel) ||
|
||||
channel->session->session_state == SSH_SESSION_STATE_ERROR)
|
||||
channel->session->session_state == SSH_SESSION_STATE_ERROR ||
|
||||
channel->state == SSH_CHANNEL_STATE_CLOSED)
|
||||
goto out;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user