Skip to content
Snippets Groups Projects
Commit 2ab1fc5b authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

handlers: expose bootstrap_next as it is needed for replan

parent 88ac2b49
No related branches found
No related tags found
No related merge requests found
......@@ -39,3 +39,6 @@ int event_flush(conf_t *conf, zone_t *zone);
int event_notify(conf_t *conf, zone_t *zone);
/*! \brief Signs the zone using its DNSSEC keys. */
int event_dnssec(conf_t *conf, zone_t *zone);
/*! \brief Get next bootstrap interval. */
uint32_t bootstrap_next(uint32_t interval);
......@@ -39,15 +39,15 @@
ZONE_QUERY_LOG(severity, zone, master, "IXFR, incoming", msg, ##__VA_ARGS__); \
}
/*! \brief Progressive bootstrap retry timer. */
static uint32_t bootstrap_next(uint32_t timer)
/*! \brief Get next bootstrap interval. */
uint32_t bootstrap_next(uint32_t interval)
{
timer *= 2;
timer += dnssec_random_uint32_t() % BOOTSTRAP_RETRY;
if (timer > BOOTSTRAP_MAXTIME) {
timer = BOOTSTRAP_MAXTIME;
interval *= 2;
interval += dnssec_random_uint32_t() % BOOTSTRAP_RETRY;
if (interval > BOOTSTRAP_MAXTIME) {
interval = BOOTSTRAP_MAXTIME;
}
return timer;
return interval;
}
/*! \brief Get SOA from zone. */
......
......@@ -68,9 +68,7 @@ static void replan_xfer(conf_t *conf, zone_t *zone, const zone_t *old_zone)
replan_event(zone, old_zone, ZONE_EVENT_XFER);
} else if (zone_contents_is_empty(zone->contents)) {
// Plan transfer anew.
// XXX: temporary workaround
// zone->bootstrap_retry = bootstrap_next(zone->bootstrap_retry);
zone->bootstrap_retry = 30;
zone->bootstrap_retry = bootstrap_next(zone->bootstrap_retry);
zone_events_schedule(zone, ZONE_EVENT_XFER, zone->bootstrap_retry);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment