[asterisk-commits] dlee: branch dlee/ASTERISK-22296 r397672 - in /team/dlee/ASTERISK-22296: main...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 26 16:19:51 CDT 2013


Author: dlee
Date: Mon Aug 26 16:19:49 2013
New Revision: 397672

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397672
Log:
MOAR CLEANUP

Modified:
    team/dlee/ASTERISK-22296/main/loader.c
    team/dlee/ASTERISK-22296/main/optional_api.c
    team/dlee/ASTERISK-22296/res/ari/internal.h
    team/dlee/ASTERISK-22296/res/res_http_websocket.c

Modified: team/dlee/ASTERISK-22296/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296/main/loader.c?view=diff&rev=397672&r1=397671&r2=397672
==============================================================================
--- team/dlee/ASTERISK-22296/main/loader.c (original)
+++ team/dlee/ASTERISK-22296/main/loader.c Mon Aug 26 16:19:49 2013
@@ -1076,9 +1076,6 @@
 		return -1;
 	}
 
-	ast_verb(1, "Loading modules%s exporting global symbols\n",
-		global_symbols ? "" : " not");
-
 	/* first, add find and add modules to heap */
 	AST_LIST_TRAVERSE_SAFE_BEGIN(load_order, order, entry) {
 		switch (load_resource(order->resource, global_symbols, resource_heap, order->required)) {
@@ -1253,9 +1250,6 @@
 	if (load_count)
 		ast_log(LOG_NOTICE, "%d modules will be loaded.\n", load_count);
 
-	ast_verb(1, "Loading %spreload modules\n",
-		preload_only ? "" : "non-");
-
 	/* first, load only modules that provide global symbols */
 	if ((res = load_resource_list(&load_order, 1, &modulecount)) < 0) {
 		goto done;

Modified: team/dlee/ASTERISK-22296/main/optional_api.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296/main/optional_api.c?view=diff&rev=397672&r1=397671&r2=397672
==============================================================================
--- team/dlee/ASTERISK-22296/main/optional_api.c (original)
+++ team/dlee/ASTERISK-22296/main/optional_api.c Mon Aug 26 16:19:49 2013
@@ -32,15 +32,14 @@
  * dangerous, since we could be called before they are initialized. This
  * includes things like AO2, malloc debug, and static mutexes.
  *
+ * Another limitation is that most functions are called from the midst of
+ * dlopen() or dlclose(), and there is no opportunity to return a failure code.
+ * The best we can do is log an error, and call ast_do_crash().
+ *
  * Fortunately, there are some constraints that help us out. The \c
  * ast_optional_api_*() are called during module loads, which happens either
  * before main(), or during dlopen() calls. These are already serialized, so we
  * don't have to lock ourselves.
- *
- * Another limitation in this implementation is that most functions are called
- * from the midst of dlopen() or dlclose(), and there is no opportunity to
- * return a failure code. The best we can do is log an error, and call
- * ast_do_crash().
  */
 
 /*! \brief A user of an optional API */

Modified: team/dlee/ASTERISK-22296/res/ari/internal.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296/res/ari/internal.h?view=diff&rev=397672&r1=397671&r2=397672
==============================================================================
--- team/dlee/ASTERISK-22296/res/ari/internal.h (original)
+++ team/dlee/ASTERISK-22296/res/ari/internal.h Mon Aug 26 16:19:49 2013
@@ -141,8 +141,22 @@
 
 /*! @} */
 
+/* Forward-declare websocket structs. This avoids including http_websocket.h,
+ * which causes optional_api stuff to happen, which makes optional_api more
+ * difficult to debug. */
+
 struct ast_websocket_server;
 
+/*!
+ * \brief Wrapper for invoking the websocket code for an incoming connection.
+ *
+ * \param ws_server WebSocket server to invoke.
+ * \param ser HTTP session.
+ * \param uri Requested URI.
+ * \param method Requested HTTP method.
+ * \param get_params Parsed query parameters.
+ * \param headers Parsed HTTP headers.
+ */
 void ari_handle_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_params,

Modified: team/dlee/ASTERISK-22296/res/res_http_websocket.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296/res/res_http_websocket.c?view=diff&rev=397672&r1=397671&r2=397672
==============================================================================
--- team/dlee/ASTERISK-22296/res/res_http_websocket.c (original)
+++ team/dlee/ASTERISK-22296/res/res_http_websocket.c Mon Aug 26 16:19:49 2013
@@ -120,11 +120,11 @@
 	ast_module_unref(ast_module_info->self);
 }
 
-static struct ast_websocket_server *ast_websocket_server_internal_create(void)
+static struct ast_websocket_server *ast_websocket_server_create_impl(void (*dtor)(void *))
 {
 	RAII_VAR(struct ast_websocket_server *, server, NULL, ao2_cleanup);
 
-	server = ao2_alloc(sizeof(*server), websocket_server_dtor);
+	server = ao2_alloc(sizeof(*server), dtor);
 	if (!server) {
 		return NULL;
 	}
@@ -138,10 +138,15 @@
 	return server;
 }
 
+static struct ast_websocket_server *ast_websocket_server_internal create(void)
+{
+	return ast_websocket_server_internal_create(websocket_server_internal_dtor);
+}
+
 struct ast_websocket_server *ast_websocket_server_create(void)
 {
 	ast_module_ref(ast_module_info->self);
-	return ast_websocket_server_internal_create();
+	return ast_websocket_server_internal_create(websocket_server_dtor);
 }
 
 /*! \brief Destructor function for sessions */




More information about the asterisk-commits mailing list