Merge branch '1.0' into 2.0

This commit is contained in:
terrafrost 2019-12-25 17:36:31 -06:00
commit de4a60de9d

View File

@ -1646,13 +1646,6 @@ class SFTP extends SSH2
}
$i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0;
}
}
}
@ -1662,12 +1655,9 @@ class SFTP extends SSH2
$i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0;
}
return true;
}
@ -2034,7 +2024,7 @@ class SFTP extends SSH2
$subtemp = $offset + $sent;
$packet = pack('Na*N3a*', strlen($handle), $handle, $subtemp / 4294967296, $subtemp, strlen($temp), $temp);
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet)) {
if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet, $i)) {
if ($mode & self::SOURCE_LOCAL_FILE) {
fclose($fp);
}
@ -2046,14 +2036,6 @@ class SFTP extends SSH2
}
$i++;
if ($i == NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) {
$i = 0;
break;
}
$i = 0;
}
}
if (!$this->_read_put_responses($i)) {
@ -2341,10 +2323,8 @@ class SFTP extends SSH2
if (!$recursive) {
return false;
}
$i = 0;
$result = $this->_delete_recursive($path, $i);
$this->_read_put_responses($i);
return $result;
return $this->_delete_recursive($path);
}
$this->_remove_from_stat_cache($path);
@ -2362,11 +2342,8 @@ class SFTP extends SSH2
* @return bool
* @access private
*/
function _delete_recursive($path, &$i)
function _delete_recursive($path)
{
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0;
$entries = $this->_list($path, true);
@ -2394,13 +2371,6 @@ class SFTP extends SSH2
$this->_remove_from_stat_cache($temp);
$i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0;
}
}
}
@ -2411,12 +2381,9 @@ class SFTP extends SSH2
$i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0;
}
return true;
}