summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Shneyder <o.shneyder@phoca-gmbh.de>2014-01-22 21:06:13 +0100
committerAndreas Schneider <asn@cryptomilk.org>2014-02-02 22:19:45 +0100
commitd90478448985a1e21cc240fd87fc5a14b4bb978a (patch)
tree5bb5d1cbf1af03520b455ec90eb607d209ddd26d
parent31fb4e1e694bac9bdf134f298e13e82a8977eb4a (diff)
downloadlibssh-d90478448985a1e21cc240fd87fc5a14b4bb978a.tar.gz
libssh-d90478448985a1e21cc240fd87fc5a14b4bb978a.tar.xz
libssh-d90478448985a1e21cc240fd87fc5a14b4bb978a.zip
Make function ssh_channel_accept() nonblocking if timeout is 0.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/channels.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c
index 17aed906..6974301d 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -2022,7 +2022,11 @@ static ssh_channel ssh_channel_accept(ssh_session session, int channeltype,
* 50 ms. So we need to decrement by 100 ms.
*/
for (t = timeout_ms; t >= 0; t -= 100) {
- ssh_handle_packets(session, 50);
+ if (timeout_ms == 0) {
+ ssh_handle_packets(session, 0);
+ } else {
+ ssh_handle_packets(session, 50);
+ }
if (session->ssh_message_list) {
iterator = ssh_list_get_iterator(session->ssh_message_list);