From 92af4b9535a8d9eee6800157a72fc87572b54df9 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 9 Oct 2017 18:28:21 +0300 Subject: 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. --- accel-pppd/radius/req.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'accel-pppd/radius/req.c') 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; -- cgit v1.2.3