From 2c82f651891d698ef1c81e685b96e51069e81f71 Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 1 Jun 2016 22:09:12 +0200 Subject: [PATCH] return correct length in ReadFrom --- common/io/buffered_writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/io/buffered_writer.go b/common/io/buffered_writer.go index 9cf1a0d5..8f8ef12b 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() } }