diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 9f60349e..157f8b8b 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3682,7 +3682,12 @@ class SSH2 $response = $this->binary_packet_buffer; $this->binary_packet_buffer = false; } else { - if ($this->curTimeout) { + $read = array($this->fsock); + $write = $except = null; + + if (!$this->curTimeout) { + @stream_select($read, $write, $except, null); + } else { if ($this->curTimeout < 0) { $this->is_timeout = true; return true;