Add the same entityq_flush() logic in ta_lookup() as it is done in
authorclaudio <claudio@openbsd.org>
Thu, 13 Jan 2022 11:47:44 +0000 (11:47 +0000)
committerclaudio <claudio@openbsd.org>
Thu, 13 Jan 2022 11:47:44 +0000 (11:47 +0000)
repo_lookup(). This fixes -n mode.
OK tb@

usr.sbin/rpki-client/repo.c

index 1d4c5c4..5451021 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: repo.c,v 1.20 2022/01/11 13:06:07 claudio Exp $ */
+/*     $OpenBSD: repo.c,v 1.21 2022/01/13 11:47:44 claudio Exp $ */
 /*
  * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1095,6 +1095,9 @@ ta_lookup(int id, struct tal *tal)
 
        rp->ta = ta_get(tal);
 
+       if (repo_state(rp) != REPO_LOADING)
+               entityq_flush(&rp->queue, rp);
+
        return rp;
 }