diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 69a64766..aa58af8f 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -3281,6 +3281,9 @@ class SFTP extends SSH2 while ($tempLength > 0) { $temp = $this->get_channel_packet(self::CHANNEL, true); if (is_bool($temp)) { + if ($temp && $this->channel_status[self::CHANNEL] === NET_SSH2_MSG_CHANNEL_CLOSE) { + $this->channel_close = true; + } $this->packet_type = false; $this->packet_buffer = ''; return false;