diff --git a/common/io/buffered_writer.go b/common/io/buffered_writer.go index 9cf1a0d5f..8f8ef12b2 100644 --- a/common/io/buffered_writer.go +++ b/common/io/buffered_writer.go @@ -33,13 +33,13 @@ func (this *BufferedWriter) ReadFrom(reader io.Reader) (int64, error) { totalBytes := int64(0) for { nBytes, err := this.buffer.FillFrom(reader) + totalBytes += int64(nBytes) if err != nil { if err == io.EOF { return totalBytes, nil } return totalBytes, err } - totalBytes += int64(nBytes) this.FlushWithoutLock() } }