summaryrefslogtreecommitdiff
path: root/minires
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-10-12 09:04:24 +0000
committerTed Lemon <source@isc.org>2000-10-12 09:04:24 +0000
commite8bc9d318d5c32a299fc6711c74466fbd41307c7 (patch)
tree36af1e224706004491b10b3dfd9468fad47d53b3 /minires
parentb2398d97384ac515255cf3e49118d0dc26a43b50 (diff)
downloadisc-dhcp-e8bc9d318d5c32a299fc6711c74466fbd41307c7.tar.gz
- Cache zones once we've looked them up, so that we don't do a bazillion
queries for each update.
Diffstat (limited to 'minires')
-rw-r--r--minires/res_findzonecut.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/minires/res_findzonecut.c b/minires/res_findzonecut.c
index 48800d1c..aae8b236 100644
--- a/minires/res_findzonecut.c
+++ b/minires/res_findzonecut.c
@@ -1,5 +1,5 @@
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_findzonecut.c,v 1.9 2000/07/17 20:51:11 mellon Exp $";
+static const char rcsid[] = "$Id: res_findzonecut.c,v 1.10 2000/10/12 09:04:24 mellon Exp $";
#endif /* not lint */
/*
@@ -175,6 +175,9 @@ res_findzonecut(res_state statp, const char *dname, ns_class class, int opts,
if ((rcode = get_glue(statp, class, &nsrrs)) == ns_r_noerror)
n = satisfy(statp, mname, &nsrrs, addrs, naddrs);
+ /* If we found the zone, cache it. */
+ if (n > 0)
+ cache_found_zone (class, zname, addrs, n);
done:
DPRINTF(("FINISH n=%d (%s)", n, (n < 0) ? strerror(errno) : "OK"));
free_nsrrset(&nsrrs);
@@ -262,7 +265,7 @@ get_soa(res_state statp, const char *dname, ns_class class,
/* Is there an SOA? */
rcode = do_query(statp, dname, class, ns_t_soa,
resp, &msg, &n);
- if (rcode != ns_r_noerror) {
+ if (n < 0) {
DPRINTF(("get_soa: do_query('%s', %s) failed (%d)",
dname, p_class(class), n));
return rcode;