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

@@ -225,36 +225,6 @@ func TestUploadResumeInvalidOffset(t *testing.T) {
os.Remove(testfile)
}
func TestIncompleteDownload(t *testing.T) {
testfile := "testfile"
file, _ := os.Create(testfile)
transfer := Transfer{
file: file,
path: file.Name(),
start: time.Now(),
bytesSent: 0,
bytesReceived: 0,
user: dataprovider.User{
Username: "testuser",
},
connectionID: "",
transferType: transferDownload,
lastActivity: time.Now(),
isNewFile: false,
protocol: protocolSFTP,
transferError: nil,
isFinished: false,
minWriteOffset: 0,
expectedSize: 10,
lock: new(sync.Mutex),
}
err := transfer.Close()
if err == nil || !strings.Contains(err.Error(), "incomplete download") {
t.Error("upoload must fail the expected size does not match")
}
os.Remove(testfile)
}
func TestReadWriteErrors(t *testing.T) {
testfile := "testfile"
file, _ := os.Create(testfile)