mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
channels: Correctly decrement timeout value in ssh_channel_accept().
BUG: https://red.libssh.org/issues/116
This commit is contained in:
@@ -1958,8 +1958,11 @@ static ssh_channel ssh_channel_accept(ssh_session session, int channeltype,
|
|||||||
struct ssh_iterator *iterator;
|
struct ssh_iterator *iterator;
|
||||||
int t;
|
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);
|
ssh_handle_packets(session, 50);
|
||||||
|
|
||||||
if (session->ssh_message_list) {
|
if (session->ssh_message_list) {
|
||||||
|
Reference in New Issue
Block a user