mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
mount: put read and write async buffers back - control with --buffer-size #1043
This commit is contained in:
parent
7fa687b3e1
commit
9a9d09845c
@ -29,7 +29,7 @@ func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) {
|
||||
}
|
||||
fh := &ReadFileHandle{
|
||||
o: o,
|
||||
r: fs.NewAccount(r, o), // account the transfer
|
||||
r: fs.NewAccountWithBuffer(r, o), // account the transfer
|
||||
}
|
||||
fs.Stats.Transferring(fh.o.Remote())
|
||||
return fh, nil
|
||||
@ -68,7 +68,6 @@ func (fh *ReadFileHandle) seek(offset int64, reopen bool) error {
|
||||
if err != nil {
|
||||
fs.Debugf(fh.o, "ReadFileHandle.Read seek close old failed: %v", err)
|
||||
}
|
||||
// fh.r = fs.NewAccount(r, fh.o) // account the transfer
|
||||
fh.r.UpdateReader(r)
|
||||
}
|
||||
fh.offset = offset
|
||||
|
@ -38,7 +38,7 @@ 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 the transfer
|
||||
r := fs.NewAccountSizeNameWithBuffer(fh.pipeReader, 0, src.Remote()) // account the transfer
|
||||
go func() {
|
||||
o, err := d.f.Put(r, src)
|
||||
fh.o = o
|
||||
|
Loading…
Reference in New Issue
Block a user