mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
sftpd download: remove check for download size
some clients, for example rclone can request only part of a file, we have no way to detect this so we haven't return an error if the downloaded size does not match the file size
This commit is contained in:
@@ -131,7 +131,6 @@ func (t *Transfer) Close() error {
|
||||
if t.isNewFile {
|
||||
numFiles = 1
|
||||
}
|
||||
t.checkDownloadSize()
|
||||
metrics.TransferCompleted(t.bytesSent, t.bytesReceived, t.transferType, t.transferError)
|
||||
if t.transferType == transferUpload && t.file != nil && t.file.Name() != t.path {
|
||||
if t.transferError == nil || uploadMode == uploadModeAtomicWithResume {
|
||||
@@ -192,12 +191,6 @@ func (t *Transfer) updateQuota(numFiles int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (t *Transfer) checkDownloadSize() {
|
||||
if t.transferType == transferDownload && t.transferError == nil && t.bytesSent < t.expectedSize {
|
||||
t.transferError = fmt.Errorf("incomplete download: %v/%v bytes transferred", t.bytesSent, t.expectedSize)
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Transfer) handleThrottle() {
|
||||
var wantedBandwidth int64
|
||||
var trasferredBytes int64
|
||||
|
||||
Reference in New Issue
Block a user