[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug where ssh_channel_request_exec hangs


Hi.  I've found a bug where ssh_channel_request_exec() will hang (I usually see it about 1 time in 60) because poll() receives a POLLOUT event when it's expecting a POLLIN event.  The attached patch seems to fix it.

Thanks!
Asher Freese


Signed-off-by: Asher Freese <afreese@xxxxxxxxxxxxxxx>


The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this message and any attachments in error and that any review, dissemination, distribution, copying or alteration of this message and/or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by electronic mail, and delete the original message.

diff -rupN libssh-0.6.3.orig/src/session.c libssh-0.6.3/src/session.c
--- libssh-0.6.3.orig/src/session.c	2014-03-04 04:14:20.000000000 -0600
+++ libssh-0.6.3/src/session.c	2014-11-20 10:13:30.743993337 -0600
@@ -526,7 +526,7 @@ int ssh_handle_packets(ssh_session sessi
 
     spoll_in = ssh_socket_get_poll_handle_in(session->socket);
     spoll_out = ssh_socket_get_poll_handle_out(session->socket);
-    ssh_poll_add_events(spoll_in, POLLIN);
+    ssh_poll_add_events(spoll_in, POLLIN|POLLOUT);
     ctx = ssh_poll_get_ctx(spoll_in);
 
     if (!ctx) {

Archive administrator: postmaster@lists.cynapses.org