Seems when a control frame following a non-fin text / binary frame, the code treats the control frame as a text or binary frame. Which seems to be incorrect.
RFC 6455 says:
o Control frames (see Section 5.5) MAY be injected in the middle of
a fragmented message. Control frames themselves MUST NOT be
fragmented.
I might be wrong, since I am just looking at the code: https://github.com/SergejJurecko/mio_httpc/blob/master/src/api/websocket.rs#L465-L481
Seems when a control frame following a non-fin text / binary frame, the code treats the control frame as a text or binary frame. Which seems to be incorrect.
RFC 6455 says:
https://tools.ietf.org/html/rfc6455#section-5.2