Fixed blocking bug in channel_poll.

This is a backport from 514ab6eed2.
This commit is contained in:
Andreas Schneider
2010-04-03 23:29:01 +02:00
parent c6fab4bf84
commit 3773366a25

View File

@@ -2007,9 +2007,10 @@ int channel_poll(ssh_channel channel, int is_stderr){
stdbuf = channel->stderr_buffer;
}
while (buffer_get_rest_len(stdbuf) == 0 && channel->remote_eof == 0) {
if (ssh_handle_packets(channel->session) <= 0) {
break;
if (buffer_get_rest_len(stdbuf) == 0 && channel->remote_eof == 0) {
if (ssh_handle_packets(channel->session) == SSH_ERROR) {
leave_function();
return SSH_ERROR;
}
}