diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index ce5a757b..b64005c4 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -479,7 +479,10 @@ class SFTP extends SSH2 $this->channel_status[self::CHANNEL] = NET_SSH2_MSG_CHANNEL_OPEN; - $this->get_channel_packet(self::CHANNEL, true); + $response = $this->get_channel_packet(self::CHANNEL, true); + if ($response === true && $this->isTimeout()) { + return false; + } $packet = Strings::packSSH2( 'CNsbs', @@ -517,6 +520,8 @@ class SFTP extends SSH2 if ($response === false) { return false; } + } else if ($response === true && $this->isTimeout()) { + return false; } $this->channel_status[self::CHANNEL] = NET_SSH2_MSG_CHANNEL_DATA;