You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RFC 6455 states, that Ping frame payload is optional:
https://tools.ietf.org/html/rfc6455#section-5.5.2:
A Ping frame MAY include "Application data".
However, the protocol implementation reads a frame using io.ReadFull, that returns
io.EOF error, if no bytes are read, and this io.EOF is treated as an error on the next
line.
The following patch solves this issue:
--- hybi.go.backup 2014-04-20 17:03:27.811047258 +0700
+++ hybi.go 2014-04-20 17:30:58.371147981 +0700
@@ -291,7 +291,7 @@
case PingFrame:
pingMsg := make([]byte, maxControlFramePayloadLength)
n, err := io.ReadFull(frame, pingMsg)
- if err != nil && err != io.ErrUnexpectedEOF {
+ if err != nil && err != io.ErrUnexpectedEOF && err !=
io.EOF {
return nil, err
}
io.Copy(ioutil.Discard, frame)
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
go.net/websocket: protocol implementation fails to respond to PingFrame without payload
x/net/websocket: protocol implementation fails to respond to PingFrame without payload
Dec 23, 2014
mikioh
changed the title
x/net/websocket: protocol implementation fails to respond to PingFrame without payload
websocket: protocol implementation fails to respond to PingFrame without payload
Jan 4, 2015
rsc
changed the title
websocket: protocol implementation fails to respond to PingFrame without payload
x/net/websocket: protocol implementation fails to respond to PingFrame without payload
Apr 14, 2015
by opennota:
The text was updated successfully, but these errors were encountered: