When the amount of data over 128K, slot "newMessage" can only receive most of the data. I found the last part of the data is in priv->payload, so I modified the code.
websocket.cpp
if (priv->frame.fin()) {
// FINAL
if (priv->frame.isControlFrame()) {
evaluateControlFrame();
} else {
if (priv->frame.opcode() == FrameType::CONTINUATION) {
// CONTINUATION
QByteArray chunk(priv->fragment);
chunk.append(priv->payload); // add this line, the last part of data
priv->fragment.clear();
priv->payload.clear(); // also clear
emit newMessage(chunk);
} else {
// NON-CONTINUATION
QByteArray chunk(priv->payload);
priv->payload.clear();
emit newMessage(chunk);
}
}
}
It seems that everything is ok
Please help to check whether this modification is feasible,thanks
version:1.4.5 protocol :websocket
When the amount of data over 128K, slot "newMessage" can only receive most of the data. I found the last part of the data is in priv->payload, so I modified the code.
websocket.cpp
It seems that everything is ok Please help to check whether this modification is feasible,thanks