ソースを参照

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);