aboutsummaryrefslogtreecommitdiffstats
path: root/main/dnsmgr.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-18 16:56:06 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-18 16:56:06 +0000
commit1db7ebcb936ca7fd165e69172f79c2e8fd620b37 (patch)
tree9f5153adc2061c533f109ecec0a901f3641c29c3 /main/dnsmgr.c
parentfb6dd0231c961987239ba47085320b9e70445fd5 (diff)
Merged revisions 69708 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69708 | file | 2007-06-18 12:51:36 -0400 (Mon, 18 Jun 2007) | 2 lines Remember the DNS lookup done when dnsmgr is called for the first time so that it does not needlessly spit out changed messages when the host really didn't change. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69709 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/dnsmgr.c')
-rw-r--r--main/dnsmgr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/dnsmgr.c b/main/dnsmgr.c
index 44a43991a..4270bb0c6 100644
--- a/main/dnsmgr.c
+++ b/main/dnsmgr.c
@@ -96,6 +96,7 @@ struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result
entry->result = result;
ast_mutex_init(&entry->lock);
strcpy(entry->name, name);
+ memcpy(&entry->last, result, sizeof(entry->last));
AST_RWLIST_WRLOCK(&entry_list);
AST_RWLIST_INSERT_HEAD(&entry_list, entry, list);
@@ -233,14 +234,14 @@ static int refresh_list(void *data)
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_2 "Refreshing DNS lookups.\n");
- AST_LIST_LOCK(info->entries);
- AST_LIST_TRAVERSE(info->entries, entry, list) {
+ AST_RWLIST_RDLOCK(info->entries);
+ AST_RWLIST_TRAVERSE(info->entries, entry, list) {
if (info->regex_present && regexec(&info->filter, entry->name, 0, NULL, 0))
continue;
dnsmgr_refresh(entry, info->verbose);
}
- AST_LIST_UNLOCK(info->entries);
+ AST_RWLIST_UNLOCK(info->entries);
ast_mutex_unlock(&refresh_lock);