diff options
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r-- | accel-pppd/radius/acct.c | 18 | ||||
-rw-r--r-- | accel-pppd/radius/auth.c | 6 | ||||
-rw-r--r-- | accel-pppd/radius/serv.c | 4 |
3 files changed, 16 insertions, 12 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c index de8ce286..7ac6e394 100644 --- a/accel-pppd/radius/acct.c +++ b/accel-pppd/radius/acct.c @@ -69,10 +69,10 @@ static void rad_acct_sent(struct rad_req_t *req, int res) __sync_add_and_fetch(&req->serv->stat_interim_sent, 1); - if (!req->hnd.tpd) { + if (!req->hnd.tpd) triton_md_register_handler(req->rpd->ses->ctrl->ctx, &req->hnd); - triton_md_enable_handler(&req->hnd, MD_MODE_READ); - } + + triton_md_enable_handler(&req->hnd, MD_MODE_READ); if (req->timeout.tpd) triton_timer_mod(&req->timeout, 0); @@ -201,10 +201,10 @@ static void rad_acct_start_sent(struct rad_req_t *req, int res) __sync_add_and_fetch(&req->serv->stat_acct_sent, 1); - if (!req->hnd.tpd) { + if (!req->hnd.tpd) triton_md_register_handler(req->rpd->ses->ctrl->ctx, &req->hnd); - triton_md_enable_handler(&req->hnd, MD_MODE_READ); - } + + triton_md_enable_handler(&req->hnd, MD_MODE_READ); if (req->timeout.tpd) triton_timer_mod(&req->timeout, 0); @@ -318,10 +318,10 @@ static void rad_acct_stop_sent(struct rad_req_t *req, int res) __sync_add_and_fetch(&req->serv->stat_acct_sent, 1); - if (!req->hnd.tpd) { + if (!req->hnd.tpd) triton_md_register_handler(req->rpd ? req->rpd->ses->ctrl->ctx : NULL, &req->hnd); - triton_md_enable_handler(&req->hnd, MD_MODE_READ); - } + + triton_md_enable_handler(&req->hnd, MD_MODE_READ); if (req->timeout.tpd) triton_timer_mod(&req->timeout, 0); diff --git a/accel-pppd/radius/auth.c b/accel-pppd/radius/auth.c index 2124c4b4..43dec233 100644 --- a/accel-pppd/radius/auth.c +++ b/accel-pppd/radius/auth.c @@ -219,10 +219,10 @@ static void rad_auth_sent(struct rad_req_t *req, int res) __sync_add_and_fetch(&req->serv->stat_auth_sent, 1); - if (!req->hnd.tpd) { + if (!req->hnd.tpd) triton_md_register_handler(req->rpd->ses->ctrl->ctx, &req->hnd); - triton_md_enable_handler(&req->hnd, MD_MODE_READ); - } + + triton_md_enable_handler(&req->hnd, MD_MODE_READ); if (req->timeout.tpd) triton_timer_mod(&req->timeout, 0); diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c index 935caa4f..58fc4349 100644 --- a/accel-pppd/radius/serv.c +++ b/accel-pppd/radius/serv.c @@ -204,6 +204,10 @@ int rad_server_req_enter(struct rad_req_t *req) req->serv->queue_cnt++; log_ppp_debug("radius(%i): queue %p\n", req->serv->id, req); pthread_mutex_unlock(&req->serv->lock); + + if (req->hnd.tpd) + triton_md_disable_handler(&req->hnd, MD_MODE_READ); + return 0; } |