improve conditional resuming of uploads

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-10-24 19:14:33 +02:00
parent 320e404e4d
commit 90bce505c4
9 changed files with 132 additions and 56 deletions

View File

@@ -101,7 +101,7 @@ func (t *transfer) Seek(offset int64, whence int) (int64, error) {
}
return ret, err
}
if t.reader != nil && t.expectedOffset == offset && whence == io.SeekStart {
if (t.reader != nil || t.writer != nil) && t.expectedOffset == offset && whence == io.SeekStart {
return offset, nil
}
t.TransferError(errors.New("seek is unsupported for this transfer"))