summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/buffer
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-15 21:07:37 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-15 21:07:37 +0000
commit85b1c8c285cf112ad025ded877e82175122fddc4 (patch)
treeb8a1a5a574b38e8da028b5b516470ea4049b1d19 /pkg/tcpip/buffer
parentce5dadac7fb3b33acebaacde8723913ec9aa50c0 (diff)
parentf1420cf48418c01694eaf3110ac411915b217d36 (diff)
Merge release-20210112.0-30-gf1420cf48 (automated)
Diffstat (limited to 'pkg/tcpip/buffer')
-rw-r--r--pkg/tcpip/buffer/view.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/view.go b/pkg/tcpip/buffer/view.go
index 5dd1b1b6b..09d3dac66 100644
--- a/pkg/tcpip/buffer/view.go
+++ b/pkg/tcpip/buffer/view.go
@@ -17,6 +17,7 @@ package buffer
import (
"bytes"
+ "fmt"
"io"
)
@@ -167,6 +168,9 @@ func (vv *VectorisedView) ReadTo(dst io.Writer, count int, peek bool) (int, erro
if err != nil {
break
}
+ if n != len(v) {
+ panic(fmt.Sprintf("io.Writer.Write succeeded with incomplete write: %d != %d", n, len(v)))
+ }
}
if !peek {
vv.TrimFront(done)