[asterisk-commits] qwell: branch 1.4 r104092 - /branches/1.4/main/config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 25 14:49:43 CST 2008


Author: qwell
Date: Mon Feb 25 14:49:42 2008
New Revision: 104092

URL: http://svn.digium.com/view/asterisk?view=rev&rev=104092
Log:
Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf.

This was basically caused because the config file itself raises the include level to 1.

I opted not to raise the include limit, because recursion here could cause very bizarre behavior.

Pointed out, and tested by jmls

(closes issue #12064)

Modified:
    branches/1.4/main/config.c

Modified: branches/1.4/main/config.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/config.c?view=diff&rev=104092&r1=104091&r2=104092
==============================================================================
--- branches/1.4/main/config.c (original)
+++ branches/1.4/main/config.c Mon Feb 25 14:49:42 2008
@@ -1330,7 +1330,8 @@
 	struct ast_config_engine *loader = &text_file_engine;
 	struct ast_config *result; 
 
-	if (cfg->include_level == cfg->max_include_level) {
+	/* The config file itself bumps include_level by 1 */
+	if (cfg->max_include_level > 0 && cfg->include_level == cfg->max_include_level + 1) {
 		ast_log(LOG_WARNING, "Maximum Include level (%d) exceeded\n", cfg->max_include_level);
 		return NULL;
 	}




More information about the asterisk-commits mailing list