mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-30 20:59:14 +00:00
Merge branch '2.0'
This commit is contained in:
commit
a773ae80bd
@ -2895,7 +2895,9 @@ class SFTP extends SSH2
|
|||||||
return $temp;
|
return $temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->curTimeout = false;
|
// in SSH2.php the timeout is cumulative per function call. eg. exec() will
|
||||||
|
// timeout after 10s. but for SFTP.php it's cumulative per packet
|
||||||
|
$this->curTimeout = $this->timeout;
|
||||||
|
|
||||||
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
||||||
|
|
||||||
@ -2918,6 +2920,13 @@ class SFTP extends SSH2
|
|||||||
$tempLength = $length;
|
$tempLength = $length;
|
||||||
$tempLength-= strlen($this->packet_buffer);
|
$tempLength-= strlen($this->packet_buffer);
|
||||||
|
|
||||||
|
|
||||||
|
// 256 * 1024 is what SFTP_MAX_MSG_LENGTH is set to in OpenSSH's sftp-common.h
|
||||||
|
if ($tempLength > 256 * 1024) {
|
||||||
|
user_error('Invalid SFTP packet size');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// SFTP packet type and data payload
|
// SFTP packet type and data payload
|
||||||
while ($tempLength > 0) {
|
while ($tempLength > 0) {
|
||||||
$temp = $this->get_channel_packet(self::CHANNEL, true);
|
$temp = $this->get_channel_packet(self::CHANNEL, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user