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++; $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++; $i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) { if (!$this->_read_put_responses($i)) {
return false; return false;
} }
$i = 0;
}
return true; return true;
} }
@ -2034,7 +2024,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)) { if (!$this->_send_sftp_packet(NET_SFTP_WRITE, $packet, $i)) {
if ($mode & self::SOURCE_LOCAL_FILE) { if ($mode & self::SOURCE_LOCAL_FILE) {
fclose($fp); fclose($fp);
} }
@ -2046,14 +2036,6 @@ 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)) {
@ -2341,10 +2323,8 @@ class SFTP extends SSH2
if (!$recursive) { if (!$recursive) {
return false; return false;
} }
$i = 0;
$result = $this->_delete_recursive($path, $i); return $this->_delete_recursive($path);
$this->_read_put_responses($i);
return $result;
} }
$this->_remove_from_stat_cache($path); $this->_remove_from_stat_cache($path);
@ -2362,11 +2342,8 @@ class SFTP extends SSH2
* @return bool * @return bool
* @access private * @access private
*/ */
function _delete_recursive($path, &$i) function _delete_recursive($path)
{ {
if (!$this->_read_put_responses($i)) {
return false;
}
$i = 0; $i = 0;
$entries = $this->_list($path, true); $entries = $this->_list($path, true);
@ -2394,13 +2371,6 @@ 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;
}
} }
} }
@ -2411,12 +2381,9 @@ class SFTP extends SSH2
$i++; $i++;
if ($i >= NET_SFTP_QUEUE_SIZE) {
if (!$this->_read_put_responses($i)) { if (!$this->_read_put_responses($i)) {
return false; return false;
} }
$i = 0;
}
return true; return true;
} }