mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Custom Effects - Clean-ups and Enhancements (#1163)
* Cleanup EffectFileHandler * Support Custom Effect Schemas and align EffectFileHandler * Change back to colon prefix for system effects * WebSockets - Fix error in handling fragmented frames * Correct missing colon updates * Update json with image file location for custom gif effects * Image effect deletion - considere full filename is stored in JSON * Correct selection lists indentions
This commit is contained in:
@@ -85,6 +85,17 @@ void WebSocketClient::handleWebSocketFrame()
|
||||
case OPCODE::BINARY:
|
||||
case OPCODE::TEXT:
|
||||
{
|
||||
// A fragmented message consists of a single frame with the FIN bit
|
||||
// clear and an opcode other than 0, followed by zero or more frames
|
||||
// with the FIN bit clear and the opcode set to 0, and terminated by
|
||||
// a single frame with the FIN bit set and an opcode of 0.
|
||||
//
|
||||
// Store frame type given by first frame
|
||||
if (_wsh.opCode != OPCODE::CONTINUATION )
|
||||
{
|
||||
_frameOpCode = _wsh.opCode;
|
||||
}
|
||||
|
||||
// check for protocol violations
|
||||
if (_onContinuation && !isContinuation)
|
||||
{
|
||||
@@ -117,15 +128,15 @@ void WebSocketClient::handleWebSocketFrame()
|
||||
if (_wsh.fin)
|
||||
{
|
||||
_onContinuation = false;
|
||||
if (_wsh.opCode == OPCODE::TEXT)
|
||||
{
|
||||
|
||||
if (_frameOpCode == OPCODE::TEXT)
|
||||
{
|
||||
_jsonAPI->handleMessage(QString(_wsReceiveBuffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
handleBinaryMessage(_wsReceiveBuffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
handleBinaryMessage(_wsReceiveBuffer);
|
||||
}
|
||||
_wsReceiveBuffer.clear();
|
||||
|
||||
}
|
||||
|
@@ -52,6 +52,9 @@ private:
|
||||
// websocket header store
|
||||
WebSocketHeader _wsh;
|
||||
|
||||
//opCode of first frame (in case of fragmented frames)
|
||||
quint8 _frameOpCode;
|
||||
|
||||
// masks for fields in the basic header
|
||||
static uint8_t const BHB0_OPCODE = 0x0F;
|
||||
static uint8_t const BHB0_RSV3 = 0x10;
|
||||
|
Reference in New Issue
Block a user