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:
Nicola Murino
2020-02-14 11:09:16 +01:00
parent 0061978db8
commit b99495ebbb
2 changed files with 0 additions and 37 deletions

View File

@@ -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