diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-09-16 08:49:26 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-09-16 10:38:14 +0200 |
commit | 3e07359a35aa3ae719dfd697211e9d1130dc94d2 (patch) | |
tree | f8bbd275cd72fc83e044b5bcc7ec14312d928169 /src/channels.c | |
parent | e9242a7a31110f1f4c25bd8d0d7cf17953fef992 (diff) | |
download | libssh-3e07359a35aa3ae719dfd697211e9d1130dc94d2.tar.gz libssh-3e07359a35aa3ae719dfd697211e9d1130dc94d2.tar.xz libssh-3e07359a35aa3ae719dfd697211e9d1130dc94d2.zip |
channels: Correctly decrement timeout value in ssh_channel_accept().
BUG: https://red.libssh.org/issues/116
Diffstat (limited to 'src/channels.c')
-rw-r--r-- | src/channels.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/channels.c b/src/channels.c index 9461125..27a29b3 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1983,8 +1983,11 @@ static ssh_channel ssh_channel_accept(ssh_session session, int channeltype, struct ssh_iterator *iterator; int t; - for (t = timeout_ms; t >= 0; t -= 50) - { + /* + * We sleep for 50 ms in ssh_handle_packets() and later sleep for + * 50 ms. So we need to decrement by 100 ms. + */ + for (t = timeout_ms; t >= 0; t -= 100) { ssh_handle_packets(session, 50); if (session->ssh_message_list) { |