[asterisk-commits] dlee: branch dlee/ASTERISK-22296-2 r397676 - in /team/dlee/ASTERISK-22296-2: ...

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


Author: dlee
Date: Mon Aug 26 16:56:21 2013
New Revision: 397676

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397676
Log:
On the one hand, this fixes the load problem.

On the other, it causes optional dependencies to always be loaded.
Probably not a good thing.

Modified:
    team/dlee/ASTERISK-22296-2/main/loader.c
    team/dlee/ASTERISK-22296-2/res/res_ari_asterisk.c
    team/dlee/ASTERISK-22296-2/res/res_ari_bridges.c
    team/dlee/ASTERISK-22296-2/res/res_ari_channels.c
    team/dlee/ASTERISK-22296-2/res/res_ari_endpoints.c
    team/dlee/ASTERISK-22296-2/res/res_ari_events.c
    team/dlee/ASTERISK-22296-2/res/res_ari_playback.c
    team/dlee/ASTERISK-22296-2/res/res_ari_recordings.c
    team/dlee/ASTERISK-22296-2/res/res_ari_sounds.c
    team/dlee/ASTERISK-22296-2/rest-api-templates/res_ari_resource.c.mustache

Modified: team/dlee/ASTERISK-22296-2/main/loader.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/main/loader.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/main/loader.c (original)
+++ team/dlee/ASTERISK-22296-2/main/loader.c Mon Aug 26 16:56:21 2013
@@ -412,7 +412,7 @@
 	   dereference it */
 
 	if (lib)
-		while (!dlclose(lib));
+		dlclose(lib);
 }
 
 static enum ast_module_load_result load_resource(const char *resource_name, unsigned int global_symbols_only, struct ast_heap *resource_heap, int required);
@@ -461,7 +461,7 @@
 	if (resource_being_loaded != (mod = AST_LIST_LAST(&module_list))) {
 		ast_log(LOG_WARNING, "Module '%s' did not register itself during load\n", resource_in);
 		/* no, it did not, so close it and return */
-		while (!dlclose(lib));
+		dlclose(lib);
 		/* note that the module's destructor will call ast_module_unregister(),
 		   which will free the structure we allocated in resource_being_loaded */
 		return NULL;
@@ -472,16 +472,14 @@
 	/* if we are being asked only to load modules that provide global symbols,
 	   and this one does not, then close it and return */
 	if (global_symbols_only && !wants_global) {
-		while (!dlclose(lib));
+		dlclose(lib);
 		return NULL;
 	}
 
-	/* This section is a workaround for a gcc 4.1 bug that has already been
-	 * fixed in later versions.  Unfortunately, some distributions, such as
-	 * RHEL/CentOS 5, distribute gcc 4.1, so we're stuck with having to deal
-	 * with this issue.  This basically ensures that optional_api modules are
-	 * loaded before any module which requires their functionality. */
-#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref)
+	/* Optional API's resolve at dlopen() time, which means that the
+	 * providing module must already be loaded. Look through nonoptreq
+	 * loading everything that's necessary
+	 */
 	if (!ast_strlen_zero(mod->info->nonoptreq)) {
 		/* Force any required dependencies to load */
 		char *each, *required_resource = ast_strdupa(mod->info->nonoptreq);
@@ -495,9 +493,8 @@
 			}
 		}
 	}
-#endif
-
-	while (!dlclose(lib));
+
+	dlclose(lib);
 	resource_being_loaded = NULL;
 
 	/* start the load process again */

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_asterisk.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_asterisk.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_asterisk.c Mon Aug 26 16:56:21 2013
@@ -305,5 +305,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Asterisk resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_bridges.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_bridges.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_bridges.c Mon Aug 26 16:56:21 2013
@@ -843,5 +843,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Bridge resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_channels.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_channels.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_channels.c Mon Aug 26 16:56:21 2013
@@ -1298,5 +1298,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Channel resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_endpoints.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_endpoints.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_endpoints.c Mon Aug 26 16:56:21 2013
@@ -264,5 +264,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Endpoint resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_events.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_events.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_events.c Mon Aug 26 16:56:21 2013
@@ -174,5 +174,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - WebSocket resource",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_playback.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_playback.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_playback.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_playback.c Mon Aug 26 16:56:21 2013
@@ -276,5 +276,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Playback control resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_recordings.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_recordings.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_recordings.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_recordings.c Mon Aug 26 16:56:21 2013
@@ -777,5 +777,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Recording resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/res/res_ari_sounds.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/res/res_ari_sounds.c?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/res/res_ari_sounds.c (original)
+++ team/dlee/ASTERISK-22296-2/res/res_ari_sounds.c Mon Aug 26 16:56:21 2013
@@ -205,5 +205,5 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - Sound resources",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);

Modified: team/dlee/ASTERISK-22296-2/rest-api-templates/res_ari_resource.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22296-2/rest-api-templates/res_ari_resource.c.mustache?view=diff&rev=397676&r1=397675&r2=397676
==============================================================================
--- team/dlee/ASTERISK-22296-2/rest-api-templates/res_ari_resource.c.mustache (original)
+++ team/dlee/ASTERISK-22296-2/rest-api-templates/res_ari_resource.c.mustache Mon Aug 26 16:56:21 2013
@@ -232,6 +232,6 @@
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "RESTful API module - {{{description}}}",
 	.load = load_module,
 	.unload = unload_module,
-	.nonoptreq = "res_ari,res_stasis",
+	.nonoptreq = "res_ari,res_stasis,res_ari_model",
 	);
 {{/api_declaration}}




More information about the asterisk-commits mailing list