From df3dab7d3f3a53fe6fa9f0c0b23effdda8f2f9c3 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 2 Jul 2023 10:44:51 -0500 Subject: [PATCH] SFTP: make it so SFTP::RESUME also sets offset of local file --- phpseclib/Net/SFTP.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 21afad16..2965d36c 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -2440,7 +2440,11 @@ class Net_SFTP extends Net_SSH2 if ($local_start >= 0) { fseek($fp, $local_start); $size-= $local_start; + } elseif ($mode & NET_SFTP_RESUME) { + fseek($fp, $offset); + $size-= $offset; } + } elseif ($dataCallback) { $size = 0; } else {