summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-05-12 13:50:15 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-05-12 13:50:15 +0400
commit0c0bdd363b63319c7484f5cfbe6dd74a15b884be (patch)
tree1e5e4f596347cd80a57af5ca68b37eb27fcd91d5 /accel-pppd/radius
parent7466e7f10fb4813a6112682dff13de5fbdd981a7 (diff)
downloadaccel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.tar.gz
accel-ppp-0c0bdd363b63319c7484f5cfbe6dd74a15b884be.zip
triton: improved epoll events handling
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/acct.c4
-rw-r--r--accel-pppd/radius/dm_coa.c3
-rw-r--r--accel-pppd/radius/req.c2
-rw-r--r--accel-pppd/radius/serv.c8
4 files changed, 9 insertions, 8 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index 161b959a..18033446 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -343,7 +343,7 @@ out:
rpd->acct_interim_timer.expire = rad_acct_interim_update;
rpd->acct_interim_timer.period = rpd->acct_interim_interval ? rpd->acct_interim_interval * 1000 : STAT_UPDATE_INTERVAL;
if (rpd->acct_interim_interval && triton_timer_add(rpd->ses->ctrl->ctx, &rpd->acct_interim_timer, 0)) {
- triton_md_unregister_handler(&rpd->acct_req->hnd);
+ triton_md_unregister_handler(&rpd->acct_req->hnd, 0);
triton_timer_del(&rpd->acct_req->timeout);
goto out_err;
}
@@ -368,7 +368,7 @@ void rad_acct_stop(struct radius_pd_t *rpd)
triton_timer_del(&rpd->acct_interim_timer);
if (rpd->acct_req) {
- triton_md_unregister_handler(&rpd->acct_req->hnd);
+ triton_md_unregister_handler(&rpd->acct_req->hnd, 0);
if (rpd->acct_req->timeout.tpd)
triton_timer_del(&rpd->acct_req->timeout);
diff --git a/accel-pppd/radius/dm_coa.c b/accel-pppd/radius/dm_coa.c
index 13719ae3..0235ba4a 100644
--- a/accel-pppd/radius/dm_coa.c
+++ b/accel-pppd/radius/dm_coa.c
@@ -268,8 +268,7 @@ static int dm_coa_read(struct triton_md_handler_t *h)
static void dm_coa_close(struct triton_context_t *ctx)
{
struct dm_coa_serv_t *serv = container_of(ctx, typeof(*serv), ctx);
- triton_md_unregister_handler(&serv->hnd);
- close(serv->hnd.fd);
+ triton_md_unregister_handler(&serv->hnd, 1);
triton_context_unregister(ctx);
}
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 70e0431f..2b789ad7 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -287,7 +287,7 @@ static void req_wakeup(struct rad_req_t *req)
struct triton_context_t *ctx = req->wait_ctx;
if (req->timeout.tpd)
triton_timer_del(&req->timeout);
- triton_md_unregister_handler(&req->hnd);
+ triton_md_unregister_handler(&req->hnd, 0);
triton_context_unregister(&req->ctx);
triton_context_wakeup(ctx);
}
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index c7b19166..6a080709 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -175,9 +175,11 @@ int rad_server_realloc(struct rad_req_t *req)
if (req->hnd.fd != -1) {
if (req->hnd.tpd)
- triton_md_unregister_handler(&req->hnd);
- close(req->hnd.fd);
- req->hnd.fd = -1;
+ triton_md_unregister_handler(&req->hnd, 1);
+ else {
+ close(req->hnd.fd);
+ req->hnd.fd = -1;
+ }
}
req->server_addr = req->serv->addr;