mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-21 20:19:02 +00:00
Revert "SFTP: don't buffer up download requests (PuTTY doesn't)"
This reverts commit 333e2e4c2b
.
This commit is contained in:
parent
6cb500d7c8
commit
db6ce986f3
@ -1701,6 +1701,13 @@ class Net_SFTP extends Net_SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
if ($i >= NET_SFTP_QUEUE_SIZE) {
|
||||||
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1710,8 +1717,11 @@ class Net_SFTP extends Net_SSH2
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if (!$this->_read_put_responses($i)) {
|
if ($i >= NET_SFTP_QUEUE_SIZE) {
|
||||||
return false;
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2081,7 +2091,7 @@ class Net_SFTP extends Net_SSH2
|
|||||||
|
|
||||||
$subtemp = $offset + $sent;
|
$subtemp = $offset + $sent;
|
||||||
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 4294967296, $subtemp, strlen($temp), $temp);
|
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 4294967296, $subtemp, strlen($temp), $temp);
|
||||||
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet, $i)) {
|
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
|
||||||
if ($mode & NET_SFTP_LOCAL_FILE) {
|
if ($mode & NET_SFTP_LOCAL_FILE) {
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
@ -2093,6 +2103,14 @@ class Net_SFTP extends Net_SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
if ($i == NET_SFTP_QUEUE_SIZE) {
|
||||||
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
$i = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->_read_put_responses($i)) {
|
if (!$this->_read_put_responses($i)) {
|
||||||
@ -2380,8 +2398,10 @@ class Net_SFTP extends Net_SSH2
|
|||||||
if (!$recursive) {
|
if (!$recursive) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
$i = 0;
|
||||||
return $this->_delete_recursive($path);
|
$result = $this->_delete_recursive($path, $i);
|
||||||
|
$this->_read_put_responses($i);
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_remove_from_stat_cache($path);
|
$this->_remove_from_stat_cache($path);
|
||||||
@ -2399,8 +2419,11 @@ class Net_SFTP extends Net_SSH2
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _delete_recursive($path)
|
function _delete_recursive($path, &$i)
|
||||||
{
|
{
|
||||||
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$entries = $this->_list($path, true);
|
$entries = $this->_list($path, true);
|
||||||
|
|
||||||
@ -2428,6 +2451,13 @@ class Net_SFTP extends Net_SSH2
|
|||||||
$this->_remove_from_stat_cache($temp);
|
$this->_remove_from_stat_cache($temp);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
if ($i >= NET_SFTP_QUEUE_SIZE) {
|
||||||
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2438,8 +2468,11 @@ class Net_SFTP extends Net_SSH2
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if (!$this->_read_put_responses($i)) {
|
if ($i >= NET_SFTP_QUEUE_SIZE) {
|
||||||
return false;
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user