mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 06:11:43 +08:00
vfs: Fix over downloading with --vfs-cache-mode full and --buffer-size 0
This was caused by the signal to stop buffering being ignored when there was no buffer! This is fixed by explicitly checking for no buffering and stopping.
This commit is contained in:
parent
05ddef117a
commit
8301a72453
|
@ -460,6 +460,14 @@ func (dl *downloader) Write(p []byte) (n int, err error) {
|
|||
fs.Debugf(dl.dls.src, "stopping download thread as it has skipped %d bytes", dl.skipped)
|
||||
dl._stop()
|
||||
}
|
||||
|
||||
// If running without a async buffer then stop now as
|
||||
// StopBuffering has no effect if the Account wasn't buffered
|
||||
// so we need to stop manually now rather than wait for the
|
||||
// AsyncReader to stop.
|
||||
if dl.stop && !dl.in.HasBuffer() {
|
||||
err = asyncreader.ErrorStreamAbandoned
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user