const char** zones;
unsigned int num_zones;
+ // How many transfers are running?
+ unsigned int running;
+
// Memory Context
isc_mem_t* memctx;
isc_log_setcontext(ctx.log);
}
+static void zone_done(dns_zone_t* zone) {
+ // Release the zone from the manager
+ dns_zonemgr_releasezone(ctx.zonemgr, zone);
+
+ // Free the zone
+ dns_zone_detach(&zone);
+
+ // Terminate if we are all done
+ if (!--ctx.running)
+ isc_loopmgr_shutdown(ctx.loopmgr);
+}
+
static void transfer_done(dns_zone_t* zone, uint32_t* serial, isc_result_t result) {
int r;
break;
}
- // Release the zone from the manager
- dns_zonemgr_releasezone(ctx.zonemgr, zone);
-
- // Free the zone
- dns_zone_detach(&zone);
+ // We are done
+ zone_done(zone);
}
static int do_transfer(dns_zone_t* zone, uint32_t serial) {
char path[PATH_MAX];
int r;
+ // Increment counter
+ ctx.running++;
+
// Create the origin
origin = dns_fixedname_initname(&fixed);