aboutsummaryrefslogtreecommitdiff
path: root/libssh/session.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2008-05-26 20:14:59 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2008-05-26 20:14:59 +0000
commit41475a2a1f2246010d24183cef871051609ff8e9 (patch)
tree48a42aa9e3cbd0a5bef75570d40a93fb681cb449 /libssh/session.c
parentc2f151ab56fb56246ac6ff946190d494e436d7a2 (diff)
downloadlibssh-41475a2a1f2246010d24183cef871051609ff8e9.tar.gz
libssh-41475a2a1f2246010d24183cef871051609ff8e9.tar.xz
libssh-41475a2a1f2246010d24183cef871051609ff8e9.zip
workaround for the bug #14
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@162 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/session.c')
-rw-r--r--libssh/session.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libssh/session.c b/libssh/session.c
index f4879f0c..28d89de6 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -162,7 +162,7 @@ void ssh_set_fd_except(SSH_SESSION *session){
*/
/* looks if there is data to read on the socket and parse it. */
int ssh_handle_packets(SSH_SESSION *session){
- int w,err,r;
+ int w,err,r,i=0;
do {
r=ssh_fd_poll(session,&w,&err);
if(r<=0)
@@ -171,7 +171,8 @@ int ssh_handle_packets(SSH_SESSION *session){
if(packet_read(session)||packet_translate(session))
return -1;
packet_parse(session);
- } while(r>0);
+ ++i;
+ } while(r>0 && i<5);
return r;
}