[svn-commits] mvanbaak: branch 1.6.0 r130752 - in /branches/1.6.0: ./ main/dnsmgr.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 14 12:22:55 CDT 2008


Author: mvanbaak
Date: Mon Jul 14 12:22:54 2008
New Revision: 130752

URL: http://svn.digium.com/view/asterisk?view=rev&rev=130752
Log:
Merged revisions 130744 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r130744 | mvanbaak | 2008-07-14 19:21:18 +0200 (Mon, 14 Jul 2008) | 18 lines

Merged revisions 130735 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130735 | mvanbaak | 2008-07-14 19:10:21 +0200 (Mon, 14 Jul 2008) | 10 lines

notify the user that dnsmgr refresh wont work when dnsmgr is not enabled.
Previously this command would automagically appear and disappear.
This was confusing.

(closes issue #12796)
Reported by: chappell
Patches:
      dnsmgr_refresh_3.diff uploaded by chappell (license 8)
Tested by: russell, chappell, mvanbaak

........

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

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/dnsmgr.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/dnsmgr.c?view=diff&rev=130752&r1=130751&r2=130752
==============================================================================
--- branches/1.6.0/main/dnsmgr.c (original)
+++ branches/1.6.0/main/dnsmgr.c Mon Jul 14 12:22:54 2008
@@ -287,20 +287,29 @@
 	case CLI_GENERATE:
 		return NULL;	
 	}
-	if (a->argc > 3)
+
+	if (!enabled) {
+		ast_cli(a->fd, "DNS Manager is disabled.\n");
+		return 0;
+	}
+
+	if (a->argc > 3) {
 		return CLI_SHOWUSAGE;
+	}
 
 	if (a->argc == 3) {
-		if ( regcomp(&info.filter, a->argv[2], REG_EXTENDED | REG_NOSUB) )
+		if (regcomp(&info.filter, a->argv[2], REG_EXTENDED | REG_NOSUB)) {
 			return CLI_SHOWUSAGE;
-		else
+		} else {
 			info.regex_present = 1;
+		}
 	}
 
 	refresh_list(&info);
 
-	if (info.regex_present)
+	if (info.regex_present) {
 		regfree(&info.filter);
+	}
 
 	return CLI_SUCCESS;
 }
@@ -416,7 +425,6 @@
 		pthread_kill(refresh_thread, SIGURG);
 		pthread_join(refresh_thread, NULL);
 		refresh_thread = AST_PTHREADT_NULL;
-		ast_cli_unregister(&cli_refresh);
 		res = 0;
 	}
 	else




More information about the svn-commits mailing list