1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

RPKI has its own loop

This commit is contained in:
Maria Matejka
2021-11-17 21:34:54 +01:00
parent 20ace7f2e6
commit 3fd1f46184
5 changed files with 22 additions and 4 deletions

View File

@@ -109,6 +109,7 @@ static void rpki_schedule_next_expire_check(struct rpki_cache *cache);
static void rpki_stop_refresh_timer_event(struct rpki_cache *cache);
static void rpki_stop_retry_timer_event(struct rpki_cache *cache);
static void rpki_stop_expire_timer_event(struct rpki_cache *cache);
static void rpki_stop_all_timers(struct rpki_cache *cache);
/*
@@ -219,6 +220,8 @@ rpki_force_restart_proto(struct rpki_proto *p)
{
if (p->cache)
{
rpki_tr_close(p->cache->tr_sock);
rpki_stop_all_timers(p->cache);
CACHE_DBG(p->cache, "Connection object destroying");
}
@@ -342,7 +345,7 @@ rpki_schedule_next_refresh(struct rpki_cache *cache)
btime t = cache->refresh_interval S;
CACHE_DBG(cache, "after %t s", t);
tm_start(cache->refresh_timer, t);
tm_start_in(cache->refresh_timer, t, cache->p->p.loop);
}
static void
@@ -351,7 +354,7 @@ rpki_schedule_next_retry(struct rpki_cache *cache)
btime t = cache->retry_interval S;
CACHE_DBG(cache, "after %t s", t);
tm_start(cache->retry_timer, t);
tm_start_in(cache->retry_timer, t, cache->p->p.loop);
}
static void
@@ -362,7 +365,7 @@ rpki_schedule_next_expire_check(struct rpki_cache *cache)
t = MAX(t, 1 S);
CACHE_DBG(cache, "after %t s", t);
tm_start(cache->expire_timer, t);
tm_start_in(cache->expire_timer, t, cache->p->p.loop);
}
static void
@@ -379,13 +382,21 @@ rpki_stop_retry_timer_event(struct rpki_cache *cache)
tm_stop(cache->retry_timer);
}
static void UNUSED
static void
rpki_stop_expire_timer_event(struct rpki_cache *cache)
{
CACHE_DBG(cache, "Stop");
tm_stop(cache->expire_timer);
}
static void
rpki_stop_all_timers(struct rpki_cache *cache)
{
rpki_stop_refresh_timer_event(cache);
rpki_stop_retry_timer_event(cache);
rpki_stop_expire_timer_event(cache);
}
static int
rpki_do_we_recv_prefix_pdu_in_last_seconds(struct rpki_cache *cache)
{