提交 0eac45fb 编写于 作者: L LiFeng

iSulad: inernal change fix bug in websocket

Signed-off-by: NLiFeng <lifeng68@huawei.com>
上级 a10406dc
......@@ -217,7 +217,8 @@ int WebsocketServer::DumpHandshakeInfo(struct lws *wsi) noexcept
lws_hdr_copy(wsi, buf, sizeof(buf), WSI_TOKEN_GET_URI);
if (strlen(buf) == 0) {
lws_close_reason(wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, (unsigned char *)("Invalid URL"), strlen("Invalid URL"));
ERROR("invalid url");
CloseWsSession(wsi);
return -1;
}
......@@ -264,10 +265,7 @@ int WebsocketServer::Wswrite(struct lws *wsi, void *in, size_t len)
auto it = m_wsis.find(wsi);
if (it != m_wsis.end()) {
if (it->second.close) {
const std::string closeMsg = "websocket session disconnected";
DEBUG(closeMsg.c_str());
lws_close_reason(wsi, LWS_CLOSE_STATUS_GOINGAWAY, (unsigned char *)(closeMsg.c_str()),
closeMsg.length());
DEBUG("websocket session disconnected");
return -1;
}
it->second.buf_mutex->lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册