summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-03-03 12:13:58 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-03-03 12:13:58 +0300
commitf5313ce5dc5192f4539eceacd621bfe193a0eb97 (patch)
treeac61d82a5615f5aa11d4e02e69f47627d0026488 /accel-pppd
parent8028b5739030e2c905d9c86ff797bcb488ae6b06 (diff)
parent120d9cb4b14fb524d71924db96cca0d91a5ca281 (diff)
downloadaccel-ppp-f5313ce5dc5192f4539eceacd621bfe193a0eb97.tar.gz
accel-ppp-f5313ce5dc5192f4539eceacd621bfe193a0eb97.zip
Merge branch '1.11' of https://github.com/xebd/accel-ppp into 1.11
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ppp/ppp.c4
-rw-r--r--accel-pppd/radius/req.c2
-rw-r--r--accel-pppd/radius/serv.c13
3 files changed, 15 insertions, 4 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c
index 264ae136..1ee26f4e 100644
--- a/accel-pppd/ppp/ppp.c
+++ b/accel-pppd/ppp/ppp.c
@@ -558,8 +558,10 @@ int __export ppp_terminate(struct ap_session *ses, int hard)
}
}
- if (!s)
+ if (!s) {
destablish_ppp(ppp);
+ return 0;
+ }
return 1;
}
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index b09b8806..b6c4cf0b 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -313,7 +313,7 @@ int __rad_req_send(struct rad_req_t *req, int async)
}
if (req->hnd.fd == -1 && make_socket(req))
- return -1;
+ return -2;
if (req->before_send && req->before_send(req))
goto out_err;
diff --git a/accel-pppd/radius/serv.c b/accel-pppd/radius/serv.c
index 7372fdc1..64db6cdf 100644
--- a/accel-pppd/radius/serv.c
+++ b/accel-pppd/radius/serv.c
@@ -227,8 +227,17 @@ int rad_server_req_enter(struct rad_req_t *req)
if (req->send) {
r = req->send(req, 0);
- if (r)
- req->active = 0;
+ if (r) {
+ if (r == -2) {
+ req->active = 0;
+ pthread_mutex_lock(&req->serv->lock);
+ req->serv->req_cnt--;
+ pthread_mutex_unlock(&req->serv->lock);
+
+ rad_server_fail(req->serv);
+ } else
+ rad_server_req_exit(req);
+ }
}
return r;