websocket crashes fixed (#1258)

This commit is contained in:
Markus 2021-07-14 20:22:13 +02:00 committed by GitHub
parent 8dc4ff9a34
commit b0e1510a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,7 +285,7 @@ qint64 WebSocketClient::sendMessage(QJsonObject obj)
quint64 position = i * FRAME_SIZE_IN_BYTES; quint64 position = i * FRAME_SIZE_IN_BYTES;
quint32 frameSize = (payloadSize-position >= FRAME_SIZE_IN_BYTES) ? FRAME_SIZE_IN_BYTES : (payloadSize-position); quint32 frameSize = (payloadSize-position >= FRAME_SIZE_IN_BYTES) ? FRAME_SIZE_IN_BYTES : (payloadSize-position);
QByteArray buf = makeFrameHeader(OPCODE::TEXT, frameSize, isLastFrame); QByteArray buf = makeFrameHeader((i == 0) ? OPCODE::TEXT : OPCODE::CONTINUATION, frameSize, isLastFrame);
sendMessage_Raw(buf); sendMessage_Raw(buf);
qint64 written = sendMessage_Raw(payload+position,frameSize); qint64 written = sendMessage_Raw(payload+position,frameSize);