From 9b49d3c590f39258db3c99aae6fdde107b74125c Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 19 May 2018 06:26:22 -0500 Subject: [PATCH] SSH2: fixes relating to delayed global requests --- phpseclib/Net/SSH2.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 33850c4b..6c87137d 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1159,11 +1159,12 @@ class Net_SSH2 } $elapsed = strtok(microtime(), ' ') + strtok('') - $start; - $this->curTimeout-= $elapsed; - - if ($this->curTimeout <= 0) { - $this->is_timeout = true; - return false; + if ($this->curTimeout) { + $this->curTimeout-= $elapsed; + if ($this->curTimeout < 0) { + $this->is_timeout = true; + return false; + } } } @@ -3695,10 +3696,6 @@ class Net_SSH2 if ($client_channel == -1 && $response === true) { return true; } - if (!strlen($response)) { - return ''; - } - if (!strlen($response)) { return false; }