diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-10-04 18:52:17 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-10-04 18:52:17 +0400 |
commit | 43a444fc65d917bf680831c0b942d682d933dc84 (patch) | |
tree | cc7c85b61e86f72795e4c3881199e3a96ddd0ca6 /accel-pppd/radius/radius.c | |
parent | cc301ec08bf329968cea8fab8a5d7c4b05a1870b (diff) | |
download | accel-ppp-43a444fc65d917bf680831c0b942d682d933dc84.tar.gz accel-ppp-43a444fc65d917bf680831c0b942d682d933dc84.zip |
radius: various bug fixes
Diffstat (limited to 'accel-pppd/radius/radius.c')
-rw-r--r-- | accel-pppd/radius/radius.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c index fa2b6a64..6cf5ead0 100644 --- a/accel-pppd/radius/radius.c +++ b/accel-pppd/radius/radius.c @@ -355,10 +355,15 @@ static void ses_finishing(struct ap_session *ses) { struct radius_pd_t *rpd = find_pd(ses); - if (!rpd->acct_started) - return; + if (rpd->auth_ctx) { + rad_server_req_cancel(rpd->auth_ctx->req, 1); + rad_req_free(rpd->auth_ctx->req); + mempool_free(rpd->auth_ctx); + rpd->auth_ctx = NULL; + } - rad_acct_stop(rpd); + if (rpd->acct_started || rpd->acct_req) + rad_acct_stop(rpd); } static void ses_finished(struct ap_session *ses) @@ -373,7 +378,7 @@ static void ses_finished(struct ap_session *ses) pthread_rwlock_unlock(&sessions_lock); if (rpd->auth_ctx) { - rad_server_req_cancel(rpd->auth_ctx->req); + rad_server_req_cancel(rpd->auth_ctx->req, 1); rad_req_free(rpd->auth_ctx->req); mempool_free(rpd->auth_ctx); rpd->auth_ctx = NULL; @@ -383,7 +388,7 @@ static void ses_finished(struct ap_session *ses) if (rpd->acct_started) rad_acct_stop_defer(rpd); else { - rad_server_req_cancel(rpd->acct_req); + rad_server_req_cancel(rpd->acct_req, 1); rad_req_free(rpd->acct_req); } } |