mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #16286 from liggitt/wsstream_cpu
Avoid CPU hotloop on client-closed websocket
This commit is contained in:
commit
fcd99461ff
@ -97,11 +97,9 @@ func ignoreReceives(ws *websocket.Conn, timeout time.Duration) {
|
|||||||
for {
|
for {
|
||||||
resetTimeout(ws, timeout)
|
resetTimeout(ws, timeout)
|
||||||
if err := websocket.Message.Receive(ws, &data); err != nil {
|
if err := websocket.Message.Receive(ws, &data); err != nil {
|
||||||
if err == io.EOF {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handshake ensures the provided user protocol matches one of the allowed protocols. It returns
|
// handshake ensures the provided user protocol matches one of the allowed protocols. It returns
|
||||||
|
Loading…
Reference in New Issue
Block a user