diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2008-10-29 00:25:31 +0000 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2008-10-29 00:25:31 +0000 |
commit | 3b25cbf13406cb2f775a8298d2224b187de16275 (patch) | |
tree | bcc58a530ec6299b225a54d17558f300ee928f75 /libssh/socket.c | |
parent | 4a3554b2fa794edec0a628610e7bfb3749d76129 (diff) | |
download | libssh-3b25cbf13406cb2f775a8298d2224b187de16275.tar.gz libssh-3b25cbf13406cb2f775a8298d2224b187de16275.tar.xz libssh-3b25cbf13406cb2f775a8298d2224b187de16275.zip |
fixed a bug where channel_poll could wait forever for a packet already in socket buffer.
Inc'ed libtool numbers
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@184 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/socket.c')
-rw-r--r-- | libssh/socket.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libssh/socket.c b/libssh/socket.c index a80d10c5..6765b36b 100644 --- a/libssh/socket.c +++ b/libssh/socket.c @@ -414,7 +414,7 @@ int ssh_socket_poll(struct socket *s, int *write, int *except){ *except=s->data_except; *write=s->data_to_write; leave_function(); - return s->data_to_read; + return s->data_to_read || (buffer_get_rest_len(s->in_buffer)>0); } #endif @@ -454,7 +454,7 @@ int ssh_socket_poll(struct socket *s, int *write, int *except){ *except=s->data_except; *write=s->data_to_write; leave_function(); - return s->data_to_read; + return s->data_to_read || (buffer_get_rest_len(s->in_buffer)>0); } #endif @@ -491,7 +491,7 @@ int ssh_socket_nonblocking_flush(struct socket *s){ } buffer_pass_bytes(s->out_buffer,w); /* refresh the socket status */ - ssh_fd_poll(session,&can_write,&except); + ssh_socket_poll(session->socket,&can_write,&except); } if(buffer_get_rest_len(s->out_buffer)>0){ leave_function(); |