Module: kamailio
Branch: 4.4
Commit: e91aec21e7f7a6f86120d1c9167b04d420369294
URL: 
https://github.com/kamailio/kamailio/commit/e91aec21e7f7a6f86120d1c9167b04d420369294

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2016-10-10T12:16:10+02:00

websocket: catch CRLFCRLF pings over websocket connections

- reported by GH #810

(cherry picked from commit 8fa51e52e9cf9dbae45069c9354cfeb36997dff9)

---

Modified: modules/websocket/ws_frame.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/e91aec21e7f7a6f86120d1c9167b04d420369294.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e91aec21e7f7a6f86120d1c9167b04d420369294.patch

---

diff --git a/modules/websocket/ws_frame.c b/modules/websocket/ws_frame.c
index e8653eb..833af22 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);


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to