Keep the values of numbered traffic counters across reloads

What a numbered counter counted now belongs to the process: a counter
rule points to the value of its number, created the first time the
number is met (from the counter file, if one is open) and shared by the
rules of that number in every configuration loaded. A reload no longer
resets it when there is no counter file, and once configurations can
outlive one another, clients of the old and the new one count into the
same value. An unnumbered counter, and those LdapPlugin makes, keep a
value of their own as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-13 19:05:59 +03:00
1 parent 8887031324
commit 8bd5c0f0fa
10 files changed
+143 -44

No files matched your search

+12 -3
View File
@@ -471,17 +471,26 @@ struct schedule {
};
/* What a traffic counter has counted. A numbered counter's lives as long as
the process, shared by the counters of that number in every configuration
loaded, so that a reload neither loses it nor splits it; an unnumbered
counter keeps its own. */
struct trafvalue {
uint64_t traf64;
time_t cleared;
time_t updated;
};
struct trafcount {
struct trafcount *next;
struct ace *ace;
unsigned number;
ROTATION type;
uint64_t traf64;
uint64_t traflim64;
char * comment;
int disabled;
time_t cleared;
time_t updated;
struct trafvalue *v; /* the shared value, or &own */
struct trafvalue own;
};
struct nserver {