Merge pull request #9643 from x890c:patch-1

PiperOrigin-RevId: 580571377
This commit is contained in:
gVisor bot
2023-11-08 10:15:45 -08:00
+6 -2
View File
@@ -87,8 +87,8 @@ func echo(wq *waiter.Queue, ep tcpip.Endpoint) {
}
for {
_, err := ep.Read(&w, tcpip.ReadOptions{})
if err != nil {
var buf bytes.Buffer
if _, err := ep.Read(&buf, tcpip.ReadOptions{}); err != nil {
if _, ok := err.(*tcpip.ErrWouldBlock); ok {
<-notifyCh
continue
@@ -96,6 +96,10 @@ func echo(wq *waiter.Queue, ep tcpip.Endpoint) {
return
}
if _, err := w.Write(buf.Bytes()); err != nil {
return
}
}
}