[asterisk-commits] russell: branch russell/iax2_ff r70858 - in /team/russell/iax2_ff: ./ cdr/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 21 15:34:52 CDT 2007


Author: russell
Date: Thu Jun 21 15:34:52 2007
New Revision: 70858

URL: http://svn.digium.com/view/asterisk?view=rev&rev=70858
Log:
Merged revisions 70841 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r70841 | murf | 2007-06-21 15:19:36 -0500 (Thu, 21 Jun 2007) | 9 lines

Merged revisions 70804 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70804 | murf | 2007-06-21 13:13:17 -0600 (Thu, 21 Jun 2007) | 1 line

it was pointed out that the cdr_custom config load could get a lock, and under certain circumstances, would never release it. I also noted that the situation where more than one mapping spec was warned about, but did not ignore further mappings as it had promised. I think I have fixed both situations.
........

................

Modified:
    team/russell/iax2_ff/   (props changed)
    team/russell/iax2_ff/cdr/cdr_custom.c

Propchange: team/russell/iax2_ff/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/russell/iax2_ff/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 21 15:34:52 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-70809
+/branches/1.4:1-70857

Modified: team/russell/iax2_ff/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/russell/iax2_ff/cdr/cdr_custom.c?view=diff&rev=70858&r1=70857&r2=70858
==============================================================================
--- team/russell/iax2_ff/cdr/cdr_custom.c (original)
+++ team/russell/iax2_ff/cdr/cdr_custom.c Thu Jun 21 15:34:52 2007
@@ -72,21 +72,22 @@
 
 	strcpy(format, "");
 	strcpy(master, "");
+	ast_mutex_lock(&lock);
 	if((cfg = ast_config_load("cdr_custom.conf"))) {
 		var = ast_variable_browse(cfg, "mappings");
 		while(var) {
-			ast_mutex_lock(&lock);
 			if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) {
 				if (strlen(var->value) > (sizeof(format) - 1))
 					ast_log(LOG_WARNING, "Format string too long, will be truncated, at line %d\n", var->lineno);
 				ast_copy_string(format, var->value, sizeof(format) - 1);
 				strcat(format,"\n");
 				snprintf(master, sizeof(master),"%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name);
-				ast_mutex_unlock(&lock);
+				if (var->next) {
+					ast_log(LOG_NOTICE, "Sorry, only one mapping is supported at this time, mapping '%s' will be ignored at line %d.\n", var->next->name, var->next->lineno); 
+					break;
+				}
 			} else
 				ast_log(LOG_NOTICE, "Mapping must have both filename and format at line %d\n", var->lineno);
-			if (var->next)
-				ast_log(LOG_NOTICE, "Sorry, only one mapping is supported at this time, mapping '%s' will be ignored at line %d.\n", var->next->name, var->next->lineno); 
 			var = var->next;
 		}
 		ast_config_destroy(cfg);
@@ -97,6 +98,7 @@
 		else
 			ast_log(LOG_WARNING, "Failed to load configuration file. Module not activated.\n");
 	}
+	ast_mutex_unlock(&lock);
 	
 	return res;
 }




More information about the asterisk-commits mailing list