mirror of
https://github.com/rclone/rclone.git
synced 2025-12-15 15:53:41 +00:00
fuse: Add bandwidth accounting and buffering
This fixes rclone mount ignoring bwlimit and increases buffering which should speed up transfers greatly. Fixes #796 Fixes #690
This commit is contained in:
@@ -38,8 +38,9 @@ func newWriteFileHandle(d *Dir, f *File, src fs.ObjectInfo) (*WriteFileHandle, e
|
||||
file: f,
|
||||
}
|
||||
fh.pipeReader, fh.pipeWriter = io.Pipe()
|
||||
r := fs.NewAccountSizeName(fh.pipeReader, 0, src.Remote()) // account and buffer the transfer
|
||||
go func() {
|
||||
o, err := d.f.Put(fh.pipeReader, src)
|
||||
o, err := d.f.Put(r, src)
|
||||
fh.o = o
|
||||
fh.result <- err
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user