Module: kamailio
Branch: master
Commit: 8fa51e52e9cf9dbae45069c9354cfeb36997dff9
URL:
https://github.com/kamailio/kamailio/commit/8fa51e52e9cf9dbae45069c9354cfeb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-10-10T11:43:23+02:00
websocket: catch CRLFCRLF pings over websocket connections
- reported by GH #810
---
Modified: modules/websocket/ws_frame.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8fa51e52e9cf9dbae45069c9354cfeb…
Patch:
https://github.com/kamailio/kamailio/commit/8fa51e52e9cf9dbae45069c9354cfeb…
---
diff --git a/modules/websocket/ws_frame.c b/modules/websocket/ws_frame.c
index 6b32f4f..6ce5287 100644
--- a/modules/websocket/ws_frame.c
+++ b/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);