mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
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:
1 parent
8887031324
commit
8bd5c0f0fa
10 files changed
+143
-44
No files matched your search
+4
-4
@@ -47,12 +47,12 @@ int alwaysauth(struct clientparam * param){
|
||||
countout = 1;
|
||||
if(tc->ace->action != COUNTALL) continue;
|
||||
}
|
||||
if(tc->traflim64 <= tc->traf64) {
|
||||
if(tc->traflim64 <= tc->v->traf64) {
|
||||
_3proxy_mutex_unlock(&tc_mutex);
|
||||
return 10;
|
||||
}
|
||||
param->trafcountfunc = conf.trafcountfunc;
|
||||
param->maxtrafin64 = tc->traflim64 - tc->traf64;
|
||||
param->maxtrafin64 = tc->traflim64 - tc->v->traf64;
|
||||
}
|
||||
}
|
||||
if(countout)for(tc = conf.trafcounter; tc; tc = tc->next) {
|
||||
@@ -62,12 +62,12 @@ int alwaysauth(struct clientparam * param){
|
||||
if(tc->ace->action != COUNTOUT && tc->ace->action != COUNTALL) {
|
||||
continue;
|
||||
}
|
||||
if(tc->traflim64 <= tc->traf64) {
|
||||
if(tc->traflim64 <= tc->v->traf64) {
|
||||
_3proxy_mutex_unlock(&tc_mutex);
|
||||
return 10;
|
||||
}
|
||||
param->trafcountfunc = conf.trafcountfunc;
|
||||
param->maxtrafout64 = tc->traflim64 - tc->traf64;
|
||||
param->maxtrafout64 = tc->traflim64 - tc->v->traf64;
|
||||
}
|
||||
}
|
||||
_3proxy_mutex_unlock(&tc_mutex);
|
||||
|
||||
Reference in new issue
Block a user