summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-10-23 17:49:49 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-10-23 17:49:49 +0400
commit1819d99a0469b1c3fe7d1e9b6fbd593d86f5052f (patch)
treec8859d85642dc8991628b106809f61ab89a82a8d /accel-pppd/radius
parent90125d7cad59c2c47e1a5765261af4a9d817e7e8 (diff)
downloadaccel-ppp-1819d99a0469b1c3fe7d1e9b6fbd593d86f5052f.tar.gz
accel-ppp-1819d99a0469b1c3fe7d1e9b6fbd593d86f5052f.zip
radius: fixed stuck during shutdown when radius server does not respond
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/acct.c18
-rw-r--r--accel-pppd/radius/req.c14
2 files changed, 18 insertions, 14 deletions
diff --git a/accel-pppd/radius/acct.c b/accel-pppd/radius/acct.c
index d6f2b18..de8ce28 100644
--- a/accel-pppd/radius/acct.c
+++ b/accel-pppd/radius/acct.c
@@ -303,15 +303,15 @@ out_err:
static void rad_acct_stop_sent(struct rad_req_t *req, int res)
{
if (res) {
- if (req->rpd)
+ if (ap_shutdown) {
+ struct radius_pd_t *rpd = req->rpd;
+
+ rad_req_free(req);
+
+ if (rpd)
+ rpd->acct_req = NULL;
+ } else if (req->rpd)
rad_acct_stop_defer(req->rpd);
- else {
- if (ap_shutdown) {
- rad_req_free(req);
- req->rpd->acct_req = NULL;
- } else
- req->try = 0;
- }
return;
}
@@ -348,6 +348,8 @@ static void rad_acct_stop_timeout(struct triton_timer_t *t)
{
struct rad_req_t *req = container_of(t, typeof(*req), timeout);
+ log_debug("timeout %p\n", req);
+
if (!req->rpd)
log_switch(triton_context_self(), NULL);
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 32fa44c..b07198f 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -353,12 +353,14 @@ int rad_req_send(struct rad_req_t *req)
req->send = __rad_req_send;
if (req->try++ == conf_max_try) {
- rad_server_req_exit(req);
-
- if (rad_server_realloc(req)) {
- if (req->rpd)
- log_ppp_warn("radius: no available servers\n");
- return -1;
+ if (req->active) {
+ rad_server_req_exit(req);
+
+ if (rad_server_realloc(req)) {
+ if (req->rpd)
+ log_ppp_warn("radius: no available servers\n");
+ return -1;
+ }
}
req->try = 1;