summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-16 00:07:58 +0000
committergVisor bot <gvisor-bot@google.com>2021-01-16 00:07:58 +0000
commit06bcbc23fd8a186b0314fc8aae50545a972d7f5c (patch)
tree082d2058c07b5b9cb3e31e515519dd21d2269734 /pkg/tcpip/transport/tcp
parent0b4604d503bfac4dfccd6f0b7e34b55dc2c9e36d (diff)
parent12d9790833cc2f6a9b197066a5ecbeb434f74164 (diff)
Merge release-20210112.0-37-g12d979083 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/endpoint.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go
index a4508e871..ea509ac73 100644
--- a/pkg/tcpip/transport/tcp/endpoint.go
+++ b/pkg/tcpip/transport/tcp/endpoint.go
@@ -1328,7 +1328,7 @@ func (e *endpoint) UpdateLastError(err *tcpip.Error) {
}
// Read implements tcpip.Endpoint.Read.
-func (e *endpoint) Read(dst io.Writer, count int, opts tcpip.ReadOptions) (tcpip.ReadResult, *tcpip.Error) {
+func (e *endpoint) Read(dst io.Writer, opts tcpip.ReadOptions) (tcpip.ReadResult, *tcpip.Error) {
e.rcvReadMu.Lock()
defer e.rcvReadMu.Unlock()
@@ -1346,9 +1346,9 @@ func (e *endpoint) Read(dst io.Writer, count int, opts tcpip.ReadOptions) (tcpip
var err error
done := 0
s := first
- for s != nil && done < count {
+ for s != nil {
var n int
- n, err = s.data.ReadTo(dst, count-done, opts.Peek)
+ n, err = s.data.ReadTo(dst, opts.Peek)
// Book keeping first then error handling.
done += n