diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2017-10-09 18:28:21 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-10-09 18:28:21 +0300 |
commit | 92af4b9535a8d9eee6800157a72fc87572b54df9 (patch) | |
tree | f1a9ef7f60d4814a6f0c673b7fce9f4d640c01f8 /accel-pppd/radius/req.c | |
parent | 2635997039354e3f992f5c2d5d18328794e2c44e (diff) | |
download | accel-ppp-xebd-92af4b9535a8d9eee6800157a72fc87572b54df9.tar.gz accel-ppp-xebd-92af4b9535a8d9eee6800157a72fc87572b54df9.zip |
radius: split request queue to 2 subqueues
1 - is high priority queue for Access-Request and Account-Request(Start)
2 - is low priority queue for Account-Request(Alive) and Account-Request(Stop)
This patch intended to prioritize sessions connecting requests over disconnects and interim updates.
Diffstat (limited to 'accel-pppd/radius/req.c')
-rw-r--r-- | accel-pppd/radius/req.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c index cc91679..b09b880 100644 --- a/accel-pppd/radius/req.c +++ b/accel-pppd/radius/req.c @@ -18,7 +18,7 @@ static int make_socket(struct rad_req_t *req); static mempool_t req_pool; -static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username, in_addr_t addr, int port) +static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username, in_addr_t addr, int port, int prio) { struct rad_plugin_t *plugin; struct ppp_t *ppp = NULL; @@ -42,6 +42,7 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons req->ts = ts.tv_sec; req->type = code == CODE_ACCESS_REQUEST ? RAD_SERV_AUTH : RAD_SERV_ACCT; + req->prio = prio; if (addr) req->serv = rad_server_get2(req->type, addr, port); @@ -142,14 +143,14 @@ out_err: return NULL; } -struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username) +struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username, int prio) { - return __rad_req_alloc(rpd, code, username, 0, 0); + return __rad_req_alloc(rpd, code, username, 0, 0, prio); } struct rad_req_t *rad_req_alloc2(struct radius_pd_t *rpd, int code, const char *username, in_addr_t addr, int port) { - struct rad_req_t *req = __rad_req_alloc(rpd, code, username, addr, port); + struct rad_req_t *req = __rad_req_alloc(rpd, code, username, addr, port, 0); if (!req) return NULL; |