diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 89c6b3df..2162b9c7 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3335,8 +3335,8 @@ class SSH2 $raw = stream_get_contents($this->fsock, $this->decrypt_block_size); if (!strlen($raw)) { - user_error('No data received from server'); - return false; + $this->bitmap = 0; + throw new ConnectionClosedException('No data received from server'); } if ($this->decrypt) {