Don't retry resolving in DNS_Name2IPAddress

Instead of retrying to resolve it in the function and blocking for a
long time, return a TryAgain status and let the caller retry it later if
necessary.
This commit is contained in:
Miroslav Lichvar
2010-04-26 16:05:56 +02:00
parent 2458325c09
commit 3d260d41b3
5 changed files with 36 additions and 33 deletions

4
conf.c
View File

@@ -754,7 +754,7 @@ parse_initstepslew(const char *line)
}
while (*p) {
if (sscanf(p, "%" SHOSTNAME_LEN "s%n", hostname, &n) == 1) {
if (DNS_Name2IPAddress(hostname, &ip_addr, 1)) {
if (DNS_Name2IPAddress(hostname, &ip_addr) == DNS_Success) {
init_srcs_ip[n_init_srcs] = ip_addr;
++n_init_srcs;
}
@@ -962,7 +962,7 @@ parse_allow_deny(const char *line, AllowDeny *list, int allow)
}
} else {
if (DNS_Name2IPAddress(p, &ip_addr, 1)) {
if (DNS_Name2IPAddress(p, &ip_addr) == DNS_Success) {
new_node = MallocNew(AllowDeny);
new_node->allow = allow;
new_node->all = all;