mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-04 05:15:22 +00:00 
			
		
		
		
	Additional updates for parsing dnsmgr.conf
Review: https://reviewboard.asterisk.org/r/1432/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -386,11 +386,9 @@ static int do_reload(int loading)
 | 
			
		||||
	struct ast_flags config_flags = { loading ? 0 : CONFIG_FLAG_FILEUNCHANGED };
 | 
			
		||||
	int interval;
 | 
			
		||||
	int was_enabled;
 | 
			
		||||
	int res = 0;
 | 
			
		||||
 | 
			
		||||
	config = ast_config_load2("dnsmgr.conf", "dnsmgr", config_flags);
 | 
			
		||||
	if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEUNCHANGED || config == CONFIG_STATUS_FILEINVALID) {
 | 
			
		||||
		return res;
 | 
			
		||||
	if ((config = ast_config_load2("dnsmgr.conf", "dnsmgr", config_flags)) == CONFIG_STATUS_FILEUNCHANGED) {
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* ensure that no refresh cycles run while the reload is in progress */
 | 
			
		||||
@@ -401,6 +399,11 @@ static int do_reload(int loading)
 | 
			
		||||
	was_enabled = enabled;
 | 
			
		||||
	enabled = 0;
 | 
			
		||||
 | 
			
		||||
	if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEINVALID) {
 | 
			
		||||
		ast_mutex_unlock(&refresh_lock);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	AST_SCHED_DEL(sched, refresh_sched);
 | 
			
		||||
 | 
			
		||||
	for (v = ast_variable_browse(config, "general"); v; v = v->next) {
 | 
			
		||||
@@ -444,5 +447,5 @@ static int do_reload(int loading)
 | 
			
		||||
	ast_mutex_unlock(&refresh_lock);
 | 
			
		||||
	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: DNSmgr\r\nStatus: %s\r/nMessage: DNSmgr reload Requested\r\n", enabled ? "Enabled" : "Disabled");
 | 
			
		||||
 | 
			
		||||
	return res;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user