服务器回复关闭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数据包后回调
* @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){
case WebSocketHeader::CLOSE:{
HttpSessionType::encode(header,nullptr,0);
@ -185,6 +189,7 @@ protected:
break;
}
_remian_data.clear();
header._mask_flag = flag;
}
/**