[sr-dev] git:master:5c58ac72: websocket: use NAME in log message, removed unreachable code

Daniel-Constantin Mierla miconda at gmail.com
Sun Jul 30 18:34:37 CEST 2017


Module: kamailio
Branch: master
Commit: 5c58ac726c1f96b6666cfd05e13a66328d46d020
URL: https://github.com/kamailio/kamailio/commit/5c58ac726c1f96b6666cfd05e13a66328d46d020

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-07-30T10:30:19+02:00

websocket: use NAME in log message, removed unreachable code

---

Modified: src/modules/websocket/ws_frame.c

---

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

---

diff --git a/src/modules/websocket/ws_frame.c b/src/modules/websocket/ws_frame.c
index 6af2bb039e..8e632892f6 100644
--- a/src/modules/websocket/ws_frame.c
+++ b/src/modules/websocket/ws_frame.c
@@ -199,11 +199,11 @@ static int encode_and_send_ws_frame(ws_frame_t *frame, conn_close_t conn_close)
 
 	if (frame->payload_len < 126) extended_length = 0;
 	else if (frame->payload_len <= USHRT_MAX ) extended_length = 2;
-	else if (frame->payload_len <= UINT_MAX) extended_length = 4;
+	else if (frame->payload_len < UINT_MAX) extended_length = 4;
 	else
 	{
-		LM_ERR("Kamailio only supports WebSocket frames with payload "
-			"<= %u\n", UINT_MAX);
+		LM_ERR(NAME " only supports WebSocket frames with payload "
+			"< %u\n", UINT_MAX);
 		return -1;
 	}
 
@@ -759,11 +759,6 @@ int ws_frame_receive(sr_event_param_t *evp)
 		wsconn_put(frame.wsc);
 		return -1;
 	}
-
-	/* how can we get here ? */
-	wsconn_put(frame.wsc);
-
-	return 0;
 }
 
 int ws_frame_transmit(sr_event_param_t *evp)




More information about the sr-dev mailing list