vfs: try to seek buffer on read only files

This commit is contained in:
Fabian Möller
2018-08-17 18:10:28 +01:00
committed by Nick Craig-Wood
parent 7d35b14138
commit 552eb8e06b
4 changed files with 167 additions and 1 deletions
+10
View File
@@ -96,6 +96,16 @@ func (acc *Account) GetReader() io.ReadCloser {
return acc.origIn
}
// GetAsyncReader returns the current AsyncReader or nil if Account is unbuffered
func (acc *Account) GetAsyncReader() *asyncreader.AsyncReader {
acc.mu.Lock()
defer acc.mu.Unlock()
if asyncIn, ok := acc.in.(*asyncreader.AsyncReader); ok {
return asyncIn
}
return nil
}
// StopBuffering stops the async buffer doing any more buffering
func (acc *Account) StopBuffering() {
if asyncIn, ok := acc.in.(*asyncreader.AsyncReader); ok {