Merged revisions 129156 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

........
r129156 | bbryant | 2008-07-08 16:00:01 -0500 (Tue, 08 Jul 2008) | 6 lines

Fix a bug in SRV lookups where dnsmgr would discard everything but the 
first SRV result from DNS before processing weights and priorities and 
dns_parse_answer wouldn't report that there were no records in DNS 
unless a failure occured. Also fixed a bug where dnsmgr_refresh would 
report that a entry was being changed when ast_gethostbyname had failed.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@129157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Brett Bryant 17 years ago
parent 7d9d663991
commit 1b3cb408f5

@ -189,6 +189,7 @@ static int dns_parse_answer(void *context,
unsigned char *fullanswer = answer; unsigned char *fullanswer = answer;
struct dn_answer *ans; struct dn_answer *ans;
dns_HEADER *h; dns_HEADER *h;
int ret = 0;
int res; int res;
int x; int x;
@ -234,14 +235,13 @@ static int dns_parse_answer(void *context,
ast_log(LOG_WARNING, "Failed to parse result\n"); ast_log(LOG_WARNING, "Failed to parse result\n");
return -1; return -1;
} }
if (res > 0) ret = 1;
return 1;
} }
} }
answer += ntohs(ans->size); answer += ntohs(ans->size);
len -= ntohs(ans->size); len -= ntohs(ans->size);
} }
return 0; return ret;
} }
#ifndef HAVE_RES_NINIT #ifndef HAVE_RES_NINIT

@ -137,7 +137,7 @@ static int srv_callback(void *context, unsigned char *answer, int len, unsigned
if (entry) if (entry)
AST_LIST_INSERT_TAIL(&c->entries, entry, list); AST_LIST_INSERT_TAIL(&c->entries, entry, list);
return 1; return 0;
} }
/* Do the bizarre SRV record weight-handling algorithm /* Do the bizarre SRV record weight-handling algorithm

Loading…
Cancel
Save