aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-04-03 23:29:01 +0200
committerAndreas Schneider <mail@cynapses.org>2010-04-03 23:29:01 +0200
commit3773366a25978a57fe990c7d2951e88d38dcb067 (patch)
tree6fecde51562dcbaaf8bac7de2b6cd5543e583396
parentc6fab4bf844023f88098c5941a70a33d378663e5 (diff)
downloadlibssh-3773366a25978a57fe990c7d2951e88d38dcb067.tar.gz
libssh-3773366a25978a57fe990c7d2951e88d38dcb067.tar.xz
libssh-3773366a25978a57fe990c7d2951e88d38dcb067.zip
Fixed blocking bug in channel_poll.
This is a backport from 514ab6eed2b520d14a1dce783e3180db11f460a4.
-rw-r--r--libssh/channels.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index b1f83161..9014a2d6 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -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;
}
}