[sr-dev] git:4.4:e91aec21: websocket: catch CRLFCRLF pings over websocket connections

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 10 12:28:24 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
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);




More information about the sr-dev mailing list