[asterisk-commits] mmichelson: branch mmichelson/npm_fixes r181282 - /team/mmichelson/npm_fixes/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 11 10:40:17 CDT 2009


Author: mmichelson
Date: Wed Mar 11 10:40:09 2009
New Revision: 181282

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=181282
Log:
Remove the NOTNOW sections from pbx.c

These sections appeared to override the hashtab lookups
and instead do a traversal of the list of contexts or extensions.
Unfortunately the logic used here was not always correct, and 
I can think of no reason that you would want to use the slower
lookup. This may have been useful at some point, but now it is
not and just adds confusion to the code.


Modified:
    team/mmichelson/npm_fixes/main/pbx.c

Modified: team/mmichelson/npm_fixes/main/pbx.c
URL: http://svn.digium.com/svn-view/asterisk/team/mmichelson/npm_fixes/main/pbx.c?view=diff&rev=181282&r1=181281&r2=181282
==============================================================================
--- team/mmichelson/npm_fixes/main/pbx.c (original)
+++ team/mmichelson/npm_fixes/main/pbx.c Wed Mar 11 10:40:09 2009
@@ -2017,7 +2017,7 @@
 #ifdef NEED_DEBUG
 	int biggest_bucket, resizes, numobjs, numbucks;
 
-	ast_log(LOG_DEBUG,"Creating Extension Trie for context %s\n", con->name);
+	ast_log(LOG_DEBUG,"Creating Extension Trie for context %s(%p)\n", con->name, con);
 	ast_hashtab_get_stats(con->root_table, &biggest_bucket, &resizes, &numobjs, &numbucks);
 	ast_log(LOG_DEBUG,"This tree has %d objects in %d bucket lists, longest list=%d objects, and has resized %d times\n",
 			numobjs, numbucks, biggest_bucket, resizes);
@@ -2505,14 +2505,6 @@
 		ast_copy_string(item.name, context, sizeof(item.name));
 
 		tmp = ast_hashtab_lookup(contexts_table, &item);
-#ifdef NOTNOW
-		tmp = NULL;
-		while ((tmp = ast_walk_contexts(tmp)) ) {
-			if (!strcmp(tmp->name, context)) {
-				break;
-			}
-		}
-#endif
 		if (!tmp) {
 			return NULL;
 		}
@@ -2695,19 +2687,6 @@
 			} else {
 				e = ast_hashtab_lookup(eroot->peer_table, &pattern);
 			}
-#ifdef NOTNOW
-			while ( (e = ast_walk_extension_priorities(eroot, e)) ) {
-				/* Match label or priority */
-				if (action == E_FINDLABEL) {
-					if (q->status < STATUS_NO_LABEL)
-						q->status = STATUS_NO_LABEL;
-					if (label && e->label && !strcmp(label, e->label))
-						break;	/* found it */
-				} else if (e->priority == priority) {
-					break;	/* found it */
-				} /* else keep searching */
-			}
-#endif
 			if (e) {	/* found a valid match */
 				q->status = STATUS_SUCCESS;
 				q->foundcontext = context;
@@ -4644,13 +4623,6 @@
 	ast_rdlock_contexts();
 	c = ast_hashtab_lookup(contexts_table,&item);
 
-#ifdef NOTNOW
-
-	while ( (c = ast_walk_contexts(c)) ) {
-		if (!strcmp(ast_get_context_name(c), context))
-			return c;
-	}
-#endif
 	if (!c)
 		ast_unlock_contexts();
 
@@ -4977,18 +4949,6 @@
 	c = ast_hashtab_lookup(contexts_table,&item);
 	if (c)
 		ret = 0;
-
-
-#ifdef NOTNOW
-
-	while ((c = ast_walk_contexts(c))) {
-		if (!strcmp(ast_get_context_name(c), context)) {
-			ret = 0;
-			break;
-		}
-	}
-
-#endif
 	ast_unlock_contexts();
 
 	/* if we found context, lock macrolock */
@@ -5017,16 +4977,6 @@
 	c = ast_hashtab_lookup(contexts_table,&item);
 	if (c)
 		ret = 0;
-#ifdef NOTNOW
-
-	while ((c = ast_walk_contexts(c))) {
-		if (!strcmp(ast_get_context_name(c), context)) {
-			ret = 0;
-			break;
-		}
-	}
-
-#endif
 	ast_unlock_contexts();
 
 	/* if we found context, unlock macrolock */




More information about the asterisk-commits mailing list