Commit 8497d8e9 authored by Daniel Salzman's avatar Daniel Salzman

timers: store also XFER timer

parent c50fa46e
......@@ -14,7 +14,7 @@ class TimerDBInfo:
self._path = path
# the order is significant
TIMERS = [ "refresh", "expire", "flush" ]
TIMERS = [ "refresh", "expire", "flush", "transfer" ]
@classmethod
def parse_dname(cls, dname):
......
......@@ -19,30 +19,33 @@
#include "contrib/wire.h"
#include "contrib/wire_ctx.h"
#define PERSISTENT_EVENT_COUNT 3
#define PERSISTENT_EVENT_COUNT 4
enum {
KEY_REFRESH = 1,
KEY_EXPIRE,
KEY_FLUSH
KEY_FLUSH,
KEY_XFER
};
// Do not change these mappings if you want backwards compatibility.
static const uint8_t event_id_to_key[ZONE_EVENT_COUNT] = {
[ZONE_EVENT_REFRESH] = KEY_REFRESH,
[ZONE_EVENT_EXPIRE] = KEY_EXPIRE,
[ZONE_EVENT_FLUSH] = KEY_FLUSH
[ZONE_EVENT_FLUSH] = KEY_FLUSH,
[ZONE_EVENT_XFER] = KEY_XFER
};
static const int key_to_event_id[PERSISTENT_EVENT_COUNT + 1] = {
[KEY_REFRESH] = ZONE_EVENT_REFRESH,
[KEY_EXPIRE] = ZONE_EVENT_EXPIRE,
[KEY_FLUSH] = ZONE_EVENT_FLUSH
[KEY_FLUSH] = ZONE_EVENT_FLUSH,
[KEY_XFER] = ZONE_EVENT_XFER
};
static bool known_event_key(uint8_t key)
{
return key <= KEY_FLUSH;
return key <= KEY_XFER;
}
#define EVENT_KEY_PAIR_SIZE (sizeof(uint8_t) + sizeof(int64_t))
......
......@@ -230,7 +230,9 @@ static zone_t *create_zone_new(conf_t *conf, const knot_dname_t *name,
zone_events_enqueue(zone, ZONE_EVENT_LOAD);
break;
case ZONE_STATUS_BOOSTRAP:
zone_events_schedule(zone, ZONE_EVENT_REFRESH, ZONE_EVENT_NOW);
if (zone_events_get_time(zone, ZONE_EVENT_XFER) == 0) {
zone_events_schedule(zone, ZONE_EVENT_REFRESH, ZONE_EVENT_NOW);
}
break;
case ZONE_STATUS_NOT_FOUND:
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment