[sr-dev] git:master:91c38814: websocket: handle unrecognized subprotocol better

Armen Babikyan armen at firespotter.com
Fri Jan 26 08:50:20 CET 2018


Module: kamailio
Branch: master
Commit: 91c388147a9328743582a92c6f1184141aa268fb
URL: https://github.com/kamailio/kamailio/commit/91c388147a9328743582a92c6f1184141aa268fb

Author: Armen Babikyan <armen at firespotter.com>
Committer: Armen Babikyan <armen at firespotter.com>
Date: 2018-01-25T17:20:35-08:00

websocket: handle unrecognized subprotocol better

---

Modified: src/modules/websocket/ws_frame.c

---

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

---

diff --git a/src/modules/websocket/ws_frame.c b/src/modules/websocket/ws_frame.c
index 9bc3268601..2739ecbc11 100644
--- a/src/modules/websocket/ws_frame.c
+++ b/src/modules/websocket/ws_frame.c
@@ -678,6 +678,9 @@ int ws_frame_receive(sr_event_param_t *evp)
 
 					return -1;
 				}
+			} else {
+				LM_ERR("Unrecognized WebSocket subprotocol: %u\n", frame.wsc->sub_protocol);
+				return -1;
 			}
 
 		case OPCODE_CLOSE:




More information about the sr-dev mailing list