mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 16:15:52 +00:00
SSH2: uploads on low speed networks could get in infinite loop
This commit is contained in:
parent
a019cf3f33
commit
239bc63618
@ -3041,6 +3041,10 @@ class Net_SFTP extends Net_SSH2
|
|||||||
*/
|
*/
|
||||||
function _send_sftp_packet($type, $data, $request_id = 1)
|
function _send_sftp_packet($type, $data, $request_id = 1)
|
||||||
{
|
{
|
||||||
|
// 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;
|
||||||
|
|
||||||
$packet = $this->use_request_id ?
|
$packet = $this->use_request_id ?
|
||||||
pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) :
|
pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) :
|
||||||
pack('NCa*', strlen($data) + 1, $type, $data);
|
pack('NCa*', strlen($data) + 1, $type, $data);
|
||||||
|
Loading…
Reference in New Issue
Block a user