Skip to content
Snippets Groups Projects
Commit 7152eba1 authored by Michiel van Baak's avatar Michiel van Baak
Browse files

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 3e9a95c1
No related branches found
No related tags found
No related merge requests found
......@@ -285,20 +285,29 @@ static char *handle_cli_refresh(struct ast_cli_entry *e, int cmd, struct ast_cli
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;
}
......@@ -414,7 +423,6 @@ static int do_reload(int loading)
pthread_kill(refresh_thread, SIGURG);
pthread_join(refresh_thread, NULL);
refresh_thread = AST_PTHREADT_NULL;
ast_cli_unregister(&cli_refresh);
res = 0;
}
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment