[svn-commits] dlee: branch dlee/ari-url-shuffle r391731 - in /team/dlee/ari-url-shuffle: re...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 13 16:27:57 CDT 2013


Author: dlee
Date: Thu Jun 13 16:27:55 2013
New Revision: 391731

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391731
Log:
Clean up

Modified:
    team/dlee/ari-url-shuffle/res/res_stasis_http.c
    team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http.c?view=diff&rev=391731&r1=391730&r2=391731
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http.c Thu Jun 13 16:27:55 2013
@@ -501,17 +501,6 @@
 	}
 }
 
-static void invoke_websocket(struct ast_websocket_server *ws_server,
-	struct ast_tcptls_session_instance *ser, const char *uri,
-	enum ast_http_method method, struct ast_variable *get_vars,
-	struct ast_variable *headers, struct ast_variable *path_vars)
-{
-	struct ast_http_uri fake_urih = {
-		.data = ws_server,
-	};
-	ast_websocket_uri_cb(ser, &fake_urih, uri, method, get_vars, headers);
-}
-
 void stasis_http_invoke(struct ast_tcptls_session_instance *ser,
 	const char *uri, enum ast_http_method method,
 	struct ast_variable *get_params, struct ast_variable *headers,
@@ -576,10 +565,13 @@
 
 	if (handler->ws_server && method == AST_HTTP_GET) {
 		/* WebSocket! */
-		invoke_websocket(handler->ws_server, ser, uri, method,
-			get_params, headers, path_vars);
-		/* Set the response code to Switching Protocols so the caller
-		 * knows what happened */
+		struct ast_http_uri fake_urih = {
+			.data = handler->ws_server,
+		};
+		ast_websocket_uri_cb(ser, &fake_urih, uri, method, get_params,
+			headers);
+		/* Since the WebSocket code handles the connection, we shouldn't
+		 * do anything else; setting no_response */
 		response->no_response = 1;
 		return;
 	}

Modified: team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache?view=diff&rev=391731&r1=391730&r2=391731
==============================================================================
--- team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache (original)
+++ team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache Thu Jun 13 16:27:55 2013
@@ -77,7 +77,7 @@
 {{#has_path_parameters}}
 	/* TODO: It's not immediately obvious how to pass path params through
 	 * the websocket code to this callback. Not needed right now, so we'll
-	 * just punt for now. */
+	 * just punt. */
 	struct ast_variable *path_vars = NULL;
 {{/has_path_parameters}}
 {{> param_parsing}}




More information about the svn-commits mailing list