From 62e89248160d3592c2d754fcaa15e37586a5b091 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Sat, 20 Sep 2014 12:18:49 +0400 Subject: rewrite of authentication/accounting procedures This patch gets rid of synchronuos style of authentication/accounting. Synchronous style of authentication/accounting produced sleeping threads which becomes a problem when lots of sessions started/stopped and all they want authorization/accounting. --- accel-pppd/ppp/ppp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'accel-pppd/ppp/ppp.c') diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 6e024805..fd572590 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -115,7 +115,7 @@ int __export establish_ppp(struct ppp_t *ppp) log_ppp_error("open(unit) /dev/ppp: %s\n", strerror(errno)); goto exit_close_chan; } - + fcntl(ppp->unit_fd, F_SETFD, fcntl(ppp->unit_fd, F_GETFD) | FD_CLOEXEC); ppp->ses.unit_idx = -1; @@ -283,7 +283,7 @@ cont: list_for_each_entry(ppp_h, &ppp->chan_handlers, entry) { if (ppp_h->proto == proto) { ppp_h->recv(ppp_h); - if (ppp->chan_fd == -1) { + if (ppp->fd == -1) { //ppp->ses.ctrl->finished(ppp); return 1; } @@ -331,7 +331,7 @@ cont: list_for_each_entry(ppp_h, &ppp->unit_handlers, entry) { if (ppp_h->proto == proto) { ppp_h->recv(ppp_h); - if (ppp->unit_fd == -1) { + if (ppp->fd == -1) { //ppp->ses.ctrl->finished(ppp); return 1; } -- cgit v1.2.3