oatpp / oatpp-websocket

oatpp-websocket submodule.
https://oatpp.io/
Apache License 2.0
78 stars 32 forks source link

The continuation frame causes the connection to drop #42

Open doufu3344 opened 1 year ago

doufu3344 commented 1 year ago

https://github.com/oatpp/oatpp-websocket/blob/d95c8ee6262d5e8051099018983715ebf4873db5/src/oatpp-websocket/WebSocket.cpp#L202-L219 In the above code, the m_lastOpcode member is not updated when processing a frame with opcode=Frame::OPCODE_CONTINUATION and fin=true , so when processing Frame::OPCODE_TEXT for the next frame, checkForContinuation() returns false and throws an exception. This results in a service disconnection. https://github.com/oatpp/oatpp-websocket/blob/d95c8ee6262d5e8051099018983715ebf4873db5/src/oatpp-websocket/WebSocket.cpp#L58-L68 The same problem exists with asynchronous implementations