[asterisk-commits] dvossel: trunk r202410 - in /trunk: include/asterisk/module.h main/loader.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 22 10:33:38 CDT 2009


Author: dvossel
Date: Mon Jun 22 10:33:35 2009
New Revision: 202410

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202410
Log:
attempting to load running modules

Modules placed in the priority heap for loading were not properly removed from the linked list.  This resulted in some modules attempting to load twice.


Modified:
    trunk/include/asterisk/module.h
    trunk/main/loader.c

Modified: trunk/include/asterisk/module.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/module.h?view=diff&rev=202410&r1=202409&r2=202410
==============================================================================
--- trunk/include/asterisk/module.h (original)
+++ trunk/include/asterisk/module.h Mon Jun 22 10:33:35 2009
@@ -58,10 +58,11 @@
 };
 
 enum ast_module_load_result {
-	AST_MODULE_LOAD_SUCCESS = 0,	/*!< Module loaded and configured */
-	AST_MODULE_LOAD_DECLINE = 1,	/*!< Module is not configured */
-	AST_MODULE_LOAD_SKIP = 2,	/*!< Module was skipped for some reason */
-	AST_MODULE_LOAD_FAILURE = -1,	/*!< Module could not be loaded properly */
+	AST_MODULE_LOAD_SUCCESS = 0,    /*!< Module loaded and configured */
+	AST_MODULE_LOAD_DECLINE = 1,    /*!< Module is not configured */
+	AST_MODULE_LOAD_SKIP = 2,       /*!< Module was skipped for some reason */
+	AST_MODULE_LOAD_PRIORITY = 3,   /*!< Module is not loaded yet, but is added to prioity heap */
+	AST_MODULE_LOAD_FAILURE = -1,   /*!< Module could not be loaded properly */
 };
 
 /*! 

Modified: trunk/main/loader.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/loader.c?view=diff&rev=202410&r1=202409&r2=202410
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Mon Jun 22 10:33:35 2009
@@ -742,9 +742,8 @@
 		mod->flags.declined = 1;
 		break;
 	case AST_MODULE_LOAD_FAILURE:
-		break;
-	case AST_MODULE_LOAD_SKIP:
-		/* modules should never return this value */
+	case AST_MODULE_LOAD_SKIP: /* modules should never return this value */
+	case AST_MODULE_LOAD_PRIORITY:
 		break;
 	}
 
@@ -806,7 +805,7 @@
 
 	if (resource_heap) {
 		ast_heap_push(resource_heap, mod);
-		res = AST_MODULE_LOAD_SKIP;
+		res = AST_MODULE_LOAD_PRIORITY;
 	} else {
 		res = start_resource(mod);
 	}
@@ -892,6 +891,9 @@
 			goto done;
 		case AST_MODULE_LOAD_SKIP:
 			break;
+		case AST_MODULE_LOAD_PRIORITY:
+			AST_LIST_REMOVE_CURRENT(entry);
+			break;
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
@@ -907,6 +909,7 @@
 			res = -1;
 			goto done;
 		case AST_MODULE_LOAD_SKIP:
+		case AST_MODULE_LOAD_PRIORITY:
 			break;
 		}
 	}




More information about the asterisk-commits mailing list