From 1497887f794b1a770c0e01a2ef3030e4229213dc Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Wed, 22 Oct 2014 19:25:43 +0400 Subject: radius: check for previous request was finished in interim update timer --- accel-pppd/radius/acct.c | 6 +++--- accel-pppd/radius/serv.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'accel-pppd/radius') diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index 7fbf1373..aa8c70b7 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -71,7 +71,7 @@ static void rad_acct_sent(struct rad_req_t *req, int res) triton_timer_del(&req->timeout); return; } - + __sync_add_and_fetch(&req->serv->stat_interim_sent, 1); if (!req->hnd.tpd) { @@ -106,7 +106,7 @@ static void rad_acct_timeout(struct triton_timer_t *t) struct rad_req_t *req = container_of(t, typeof(*req), timeout); time_t dt; struct timespec ts; - + rad_server_req_exit(req); rad_server_timeout(req->serv); @@ -157,7 +157,7 @@ static void rad_acct_interim_update(struct triton_timer_t *t) struct radius_pd_t *rpd = container_of(t, typeof(*rpd), acct_interim_timer); struct timespec ts; - if (rpd->acct_req->timeout.tpd) + if (rpd->acct_req->entry.next || rpd->acct_req->timeout.tpd) return; if (rpd->session_timeout.expire_tv.tv_sec && diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c index 66931353..43778ca1 100644 --- a/accel-pppd/radius/serv.c +++ b/accel-pppd/radius/serv.c @@ -179,6 +179,7 @@ int rad_server_req_enter(struct rad_req_t *req) } assert(!req->active); + assert(!req->entry.next); pthread_mutex_lock(&req->serv->lock); -- cgit v1.2.3