[asterisk-commits] res http websocket.c: Fix some off nominal path cleanup. (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 19 08:43:01 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: res_http_websocket.c: Fix some off nominal path cleanup.
......................................................................


res_http_websocket.c: Fix some off nominal path cleanup.

* Remove extraneous unlock on off-nominal path.
* Add missing HTTP error reply.

Change-Id: I1f402bfe448fba8696b507477cab5f060ccd9b2b
---
M res/res_http_websocket.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index c2d1b18..b6baa3c 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -207,7 +207,6 @@
 
 	protocol = ast_websocket_sub_protocol_alloc(name);
 	if (!protocol) {
-		ao2_unlock(server->protocols);
 		return -1;
 	}
 	protocol->session_established = callback;
@@ -824,6 +823,7 @@
 		    && protocol_handler->session_attempted(ser, get_vars, headers)) {
 			ast_debug(3, "WebSocket connection from '%s' rejected by protocol handler '%s'\n",
 				ast_sockaddr_stringify(&ser->remote_address), protocol_handler->name);
+			websocket_bad_request(ser);
 			ao2_ref(protocol_handler, -1);
 			return 0;
 		}

-- 
To view, visit https://gerrit.asterisk.org/1116
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f402bfe448fba8696b507477cab5f060ccd9b2b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list