From 5f341806b7abf7e63ca25d2bc3c89e51b0146e99 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Thu, 13 Jul 2023 13:13:36 +0300 Subject: [PATCH] Deadloc on traffcount fixed --- src/auth.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/auth.c b/src/auth.c index d425d29..09d017a 100644 --- a/src/auth.c +++ b/src/auth.c @@ -683,7 +683,10 @@ int alwaysauth(struct clientparam * param){ countout = 1; if(tc->ace->action != COUNTALL) continue; } - if(tc->traflim64 <= tc->traf64) return 10; + if(tc->traflim64 <= tc->traf64) { + pthread_mutex_unlock(&tc_mutex); + return 10; + } param->trafcountfunc = conf.trafcountfunc; param->maxtrafin64 = tc->traflim64 - tc->traf64; } @@ -695,7 +698,10 @@ int alwaysauth(struct clientparam * param){ if(tc->ace->action != COUNTOUT && tc->ace->action != COUNTALL) { continue; } - if(tc->traflim64 <= tc->traf64) return 10; + if(tc->traflim64 <= tc->traf64) { + pthread_mutex_unlock(&tc_mutex); + return 10; + } param->trafcountfunc = conf.trafcountfunc; param->maxtrafout64 = tc->traflim64 - tc->traf64; }