[asterisk-commits] dlee: branch dlee/ari-url-shuffle r392491 - in /team/dlee/ari-url-shuffle: re...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 21 17:07:10 CDT 2013


Author: dlee
Date: Fri Jun 21 17:07:08 2013
New Revision: 392491

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392491
Log:
Addressed review feedback.
 * Used ao2_callback for much good
 * Formatting
 * Replaced 'int r' with 'int res'

Modified:
    team/dlee/ari-url-shuffle/res/res_http_websocket.c
    team/dlee/ari-url-shuffle/res/res_stasis_http.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_events.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c
    team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache

Modified: team/dlee/ari-url-shuffle/res/res_http_websocket.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_http_websocket.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_http_websocket.c (original)
+++ team/dlee/ari-url-shuffle/res/res_http_websocket.c Fri Jun 21 17:07:08 2013
@@ -503,19 +503,13 @@
 static struct websocket_protocol *one_protocol(
 	struct ast_websocket_server *server)
 {
-	struct websocket_protocol *protocol;
-	struct ao2_iterator i;
 	SCOPED_AO2LOCK(lock, server->protocols);
 
 	if (ao2_container_count(server->protocols) != 1) {
 		return NULL;
 	}
 
-	i = ao2_iterator_init(server->protocols, 0);
-	protocol = ao2_iterator_next(&i);
-	ast_assert(protocol != NULL);
-	ao2_iterator_destroy(&i);
-	return protocol;
+	return ao2_callback(server->protocols, OBJ_NOLOCK, NULL, NULL);
 }
 
 int ast_websocket_uri_cb(struct ast_tcptls_session_instance *ser, const struct ast_http_uri *urih, const char *uri, enum ast_http_method method, struct ast_variable *get_vars, struct ast_variable *headers)

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=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http.c Fri Jun 21 17:07:08 2013
@@ -922,7 +922,6 @@
 		return AST_MODULE_LOAD_DECLINE;
 	}
 
-
 	if (is_enabled()) {
 		ast_http_uri_link(&http_uri);
 	}

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c Fri Jun 21 17:07:08 2013
@@ -88,10 +88,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&asterisk);
-	return r;
+	res |= stasis_http_add_handler(&asterisk);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c Fri Jun 21 17:07:08 2013
@@ -276,10 +276,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&bridges);
-	return r;
+	res |= stasis_http_add_handler(&bridges);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c Fri Jun 21 17:07:08 2013
@@ -510,10 +510,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&channels);
-	return r;
+	res |= stasis_http_add_handler(&channels);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c Fri Jun 21 17:07:08 2013
@@ -139,10 +139,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&endpoints);
-	return r;
+	res |= stasis_http_add_handler(&endpoints);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_events.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_events.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_events.c Fri Jun 21 17:07:08 2013
@@ -78,16 +78,16 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	events.ws_server = ast_websocket_server_create();
 	if (!events.ws_server) {
 		return AST_MODULE_LOAD_FAILURE;
 	}
-	r |= ast_websocket_server_add_protocol(events.ws_server,
+	res |= ast_websocket_server_add_protocol(events.ws_server,
 		"ari", stasis_http_event_websocket_ws_cb);
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&events);
-	return r;
+	res |= stasis_http_add_handler(&events);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c Fri Jun 21 17:07:08 2013
@@ -149,10 +149,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&playback);
-	return r;
+	res |= stasis_http_add_handler(&playback);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c Fri Jun 21 17:07:08 2013
@@ -383,10 +383,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&recordings);
-	return r;
+	res |= stasis_http_add_handler(&recordings);
+	return res;
 }
 
 static int unload_module(void)

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c?view=diff&rev=392491&r1=392490&r2=392491
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c Fri Jun 21 17:07:08 2013
@@ -115,10 +115,10 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&sounds);
-	return r;
+	res |= stasis_http_add_handler(&sounds);
+	return res;
 }
 
 static int unload_module(void)

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=392491&r1=392490&r2=392491
==============================================================================
--- 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 Fri Jun 21 17:07:08 2013
@@ -99,7 +99,7 @@
 
 static int load_module(void)
 {
-	int r = 0;
+	int res = 0;
 {{#apis}}
 {{#has_websocket}}
 	{{full_name}}.ws_server = ast_websocket_server_create();
@@ -109,14 +109,14 @@
 {{/has_websocket}}
 {{#operations}}
 {{#is_websocket}}
-	r |= ast_websocket_server_add_protocol({{full_name}}.ws_server,
+	res |= ast_websocket_server_add_protocol({{full_name}}.ws_server,
 		"{{websocket_protocol}}", stasis_http_{{c_nickname}}_ws_cb);
 {{/is_websocket}}
 {{/operations}}
 {{/apis}}
 	stasis_app_ref();
-	r |= stasis_http_add_handler(&{{root_full_name}});
-	return r;
+	res |= stasis_http_add_handler(&{{root_full_name}});
+	return res;
 }
 
 static int unload_module(void)




More information about the asterisk-commits mailing list