mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-09-28 07:09:01 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
c18159618e
@ -1646,6 +1646,13 @@ class SFTP extends SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
|
if ($i >= NET_SFTP_QUEUE_SIZE) {
|
||||||
|
if (!$this->_read_put_responses($i)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$i = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1655,8 +1662,11 @@ class SFTP extends 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;
|
||||||
@ -2024,7 +2034,7 @@ class SFTP extends 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 & self::SOURCE_LOCAL_FILE) {
|
if ($mode & self::SOURCE_LOCAL_FILE) {
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
@ -2036,6 +2046,14 @@ class SFTP extends 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)) {
|
||||||
@ -2323,8 +2341,10 @@ class SFTP extends 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);
|
||||||
@ -2342,8 +2362,11 @@ class SFTP extends 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);
|
||||||
|
|
||||||
@ -2371,6 +2394,13 @@ class SFTP extends 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2381,8 +2411,11 @@ class SFTP extends 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