From 26037ecb22b2bd386423b7508cbdff870a3fc360 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 24 Apr 2000 23:30:46 +0000 Subject: [PATCH] Unlock zone->lock when skipping zone load because of database file's age. Log at ISC_LOG_DEBUG(1) when dns_zone_load is entered, when it skips loading because the file is older than the last load time, and when it has successfully loaded the zone. --- lib/dns/zone.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 1a360f1ea2..a62006c861 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: zone.c,v 1.99 2000/04/24 21:59:08 tale Exp $ */ +/* $Id: zone.c,v 1.100 2000/04/24 23:30:46 tale Exp $ */ #include @@ -675,6 +675,8 @@ dns_zone_load(dns_zone_t *zone) { REQUIRE(zone->dbname != NULL); + zone_log(zone, me, ISC_LOG_DEBUG(1), "start"); + /* * Don't do the load if the file that stores the zone is older * than the last time the zone was loaded. If the zone has not @@ -682,8 +684,12 @@ dns_zone_load(dns_zone_t *zone) { */ result = isc_file_getmodtime(zone->dbname, &filetime); if (result == ISC_R_SUCCESS && ! isc_time_isepoch(&zone->loadtime) && - isc_time_compare(&filetime, &zone->loadtime) < 0) - return (ISC_R_SUCCESS); + isc_time_compare(&filetime, &zone->loadtime) < 0) { + zone_log(zone, me, ISC_LOG_DEBUG(1), + "skipping: database file older than last load"); + result = ISC_R_SUCCESS; + goto cleanup; + } /* * Store the current time before the zone is loaded, so that if the @@ -727,6 +733,8 @@ dns_zone_load(dns_zone_t *zone) { zone->loadtime = loadtime; + zone_log(zone, me, ISC_LOG_DEBUG(1), "loaded"); + /* * Apply update log, if any. */