summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-09-30 17:39:23 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-09-30 17:39:23 +0400
commitb5fb72e983f6a2eaa8a52b713e9c7890652f8071 (patch)
treef070947f6fdbc63ee3894fc020c3416f453b5603 /accel-pppd
parent1dfbc6bd3238a185c99ae4f26d7e57072c7906c7 (diff)
downloadaccel-ppp-xebd-b5fb72e983f6a2eaa8a52b713e9c7890652f8071.tar.gz
accel-ppp-xebd-b5fb72e983f6a2eaa8a52b713e9c7890652f8071.zip
radius: fixed handling deferred requests
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/radius/serv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index e245c0b..441936c 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -145,6 +145,9 @@ int rad_server_req_cancel(struct rad_req_t *req)
if (req->timeout.tpd)
triton_timer_del(&req->timeout);
+
+ if (req->hnd.tpd)
+ triton_md_unregister_handler(&req->hnd, 0);
return r;
}
@@ -180,7 +183,7 @@ int rad_server_req_enter(struct rad_req_t *req)
if (req->send) {
list_add_tail(&req->entry, &req->serv->req_queue);
req->serv->queue_cnt++;
- log_ppp_debug("radius(%i): queue\n", req->serv->id);
+ log_ppp_debug("radius(%i): queue %p\n", req->serv->id, req);
pthread_mutex_unlock(&req->serv->lock);
return 0;
}
@@ -216,11 +219,12 @@ void rad_server_req_exit(struct rad_req_t *req)
assert(req->serv->req_cnt >= 0);
if (req->serv->req_cnt < req->serv->req_limit && !list_empty(&req->serv->req_queue)) {
struct rad_req_t *r = list_entry(req->serv->req_queue.next, typeof(*r), entry);
+ log_ppp_debug("radius(%i): wakeup %p\n", req->serv->id, r);
list_del(&r->entry);
req->serv->queue_cnt--;
req->serv->req_cnt++;
r->active = 1;
- triton_context_call(r->rpd->ses->ctrl->ctx, (triton_event_func)req_wakeup, r);
+ triton_context_call(r->rpd ? r->rpd->ses->ctrl->ctx : NULL, (triton_event_func)req_wakeup, r);
}
pthread_mutex_unlock(&req->serv->lock);
}