Temporary solution

Due to the wrong interpretation of the OpCode, larger WebSocket frames are interpreted as a binary message. A new implementation of the WebSocket protocol in Hyperion is necessary. The QT class QWebSocketServer does not have this problem. However, this can not be mixed with an existing QTcpServer implementation without using a new WebSocket port.
This commit is contained in:
Paulchen Panther 2019-01-13 20:14:05 +01:00 committed by GitHub
parent 28aa6a6954
commit 38946a0b06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,14 +115,14 @@ void WebSocketClient::handleWebSocketFrame(void)
if (_wsh.fin) if (_wsh.fin)
{ {
_onContinuation = false; _onContinuation = false;
if (_wsh.opCode == OPCODE::TEXT) // if (_wsh.opCode == OPCODE::TEXT)
{ // {
_jsonAPI->handleMessage(QString(_wsReceiveBuffer)); _jsonAPI->handleMessage(QString(_wsReceiveBuffer));
} // }
else // else
{ // {
handleBinaryMessage(_wsReceiveBuffer); // handleBinaryMessage(_wsReceiveBuffer);
} // }
_wsReceiveBuffer.clear(); _wsReceiveBuffer.clear();
} }
} }