summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/acct.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2011-01-10 22:28:34 +0300
committerDmitry Kozlov <xeb@mail.ru>2011-01-10 22:28:34 +0300
commit83537ad5c8839c6c006c4a8d5f5b0405f7ac3dae (patch)
treee60e599e366c1e50f6f175dab93b316bf9674033 /accel-pppd/radius/acct.c
parent57ec76a3e15006c94e579662ce710bfd3f032331 (diff)
downloadaccel-ppp-83537ad5c8839c6c006c4a8d5f5b0405f7ac3dae.tar.gz
accel-ppp-83537ad5c8839c6c006c4a8d5f5b0405f7ac3dae.zip
radius: don't send interim-update if time to session timeout is less than 10 s.
Diffstat (limited to 'accel-pppd/radius/acct.c')
-rw-r--r--accel-pppd/radius/acct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index ddb3e086..cbb23d53 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -15,6 +15,7 @@
#include "memdebug.h"
#define STAT_UPDATE_INTERVAL (10 * 60 * 1000)
+#define INTERIM_SAFE_TIME 10
static int req_set_RA(struct rad_req_t *req, const char *secret)
{
@@ -150,6 +151,10 @@ static void rad_acct_interim_update(struct triton_timer_t *t)
if (rpd->acct_req->timeout.tpd)
return;
+ if (rpd->session_timeout.expire_tv.tv_sec &&
+ rpd->session_timeout.expire_tv.tv_sec - (time(NULL) - rpd->ppp->start_time) < INTERIM_SAFE_TIME)
+ return;
+
req_set_stat(rpd->acct_req, rpd->ppp);
if (!rpd->acct_interim_interval)
return;