Properly account entity_queue when the file has already been seen
authorjob <job@openbsd.org>
Mon, 30 Aug 2021 16:05:55 +0000 (16:05 +0000)
committerjob <job@openbsd.org>
Mon, 30 Aug 2021 16:05:55 +0000 (16:05 +0000)
Thanks to Ben Maddison for helping create a test case

OK claudio@

usr.sbin/rpki-client/main.c

index fdd9910..ff6713d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: main.c,v 1.144 2021/06/29 17:43:57 deraadt Exp $ */
+/*     $OpenBSD: main.c,v 1.145 2021/08/30 16:05:55 job Exp $ */
 /*
  * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -122,6 +122,7 @@ entity_write_req(const struct entity *ent)
 
        if (filepath_add(&fpt, ent->file) == 0) {
                warnx("%s: File already visited", ent->file);
+               entity_queue--;
                return;
        }