diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index cdb7cb39..d7abec67 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1124,11 +1124,12 @@ class SSH2 } $elapsed = microtime(true) - $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; + } } } @@ -3592,10 +3593,6 @@ class SSH2 if ($client_channel == -1 && $response === true) { return true; } - if (!strlen($response)) { - return ''; - } - if (!strlen($response)) { return false; }