服务器回复关闭mask

This commit is contained in:
xiongziliang 2018-09-27 18:17:11 +08:00
parent 37d19c250a
commit 0c64389334

View File

@ -160,7 +160,11 @@ protected:
* webSocket数据包后回调 * webSocket数据包后回调
* @param header * @param header
*/ */
void onWebSocketDecodeComplete(const WebSocketHeader &header) override { void onWebSocketDecodeComplete(const WebSocketHeader &header_in) override {
WebSocketHeader& header = const_cast<WebSocketHeader&>(header_in);
auto flag = header._mask_flag;
header._mask_flag = false;
switch (header._opcode){ switch (header._opcode){
case WebSocketHeader::CLOSE:{ case WebSocketHeader::CLOSE:{
HttpSessionType::encode(header,nullptr,0); HttpSessionType::encode(header,nullptr,0);
@ -185,6 +189,7 @@ protected:
break; break;
} }
_remian_data.clear(); _remian_data.clear();
header._mask_flag = flag;
} }
/** /**