resolve websocket codex

description:resolve websocket codex
issue:https://gitee.com/openharmony/arkcompiler_toolchain/issues/I632EO

Signed-off-by: buzhuyu <buzhuyu@huawei.com>
This commit is contained in:
buzhuyu 2022-11-25 10:49:46 +08:00
parent b21eaab333
commit 2ecec0def6

View File

@ -32,7 +32,7 @@ void WebSocket::SendReply(const std::string& message) const
uint32_t msgLen = message.length();
std::unique_ptr<char []> msgBuf = std::make_unique<char []>(msgLen + 11); // 11: the maximum expandable length
char* sendBuf = msgBuf.get();
int32_t sendMsgLen;
uint32_t sendMsgLen;
sendBuf[0] = 0x81; // 0x81: the text message sent by the server should start with '0x81'.
// Depending on the length of the messages, server will use shift operation to get the res