diff --git a/bfe_bufio/bufio.go b/bfe_bufio/bufio.go index 997f20745..2dcc937f9 100644 --- a/bfe_bufio/bufio.go +++ b/bfe_bufio/bufio.go @@ -107,7 +107,10 @@ func (b *Reader) fill() { b.w -= b.r b.r = 0 } - + // make sure the buff can be written + if b.w >= len(b.buf) { + return + } // Read new data. n, err := b.rd.Read(b.buf[b.w:]) if n < 0 {