浏览代码

websocket: catch CRLFCRLF pings over websocket connections

- reported by GH #810
Daniel-Constantin Mierla 9 年之前
父节点
当前提交
8fa51e52e9
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      modules/websocket/ws_frame.c

+ 3 - 1
modules/websocket/ws_frame.c

@@ -686,8 +686,10 @@ int ws_frame_receive(void *data)
 				frame.payload_data);
 			update_stat(ws_sip_received_frames, 1);
 
-			if(frame.payload_len==CRLF_LEN
+			if((frame.payload_len==CRLF_LEN
 					&& strncmp(frame.payload_data, CRLF, CRLF_LEN)==0)
+					|| (frame.payload_len==CRLFCRLF_LEN
+					&& strncmp(frame.payload_data, CRLFCRLF, CRLFCRLF_LEN)==0))
 			{
 				ws_send_crlf(frame.wsc, opcode);
 				wsconn_put(frame.wsc);