diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-01-24 23:59:35 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-24 23:59:35 +0400 |
commit | fd85910188c8ae59e7f3e1ce321b831913ec0744 (patch) | |
tree | 9f6740d23bc746525614dff768330677f94b4fa3 /accel-pppd | |
parent | cf3de06a3346854d770ba147f081e3b22e93c1bc (diff) | |
download | accel-ppp-fd85910188c8ae59e7f3e1ce321b831913ec0744.tar.gz accel-ppp-fd85910188c8ae59e7f3e1ce321b831913ec0744.zip |
altered session finishing procedure
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/extra/pppd_compat.c | 2 | ||||
-rw-r--r-- | accel-pppd/include/events.h | 1 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp.c | 8 | ||||
-rw-r--r-- | accel-pppd/session.c | 9 |
4 files changed, 7 insertions, 13 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c index 5558d837..58376985 100644 --- a/accel-pppd/extra/pppd_compat.c +++ b/accel-pppd/extra/pppd_compat.c @@ -544,7 +544,7 @@ static void init(void) triton_event_register_handler(EV_SES_STARTING, (triton_event_func)ev_ses_starting); triton_event_register_handler(EV_SES_PRE_UP, (triton_event_func)ev_ses_pre_up); triton_event_register_handler(EV_SES_STARTED, (triton_event_func)ev_ses_started); - triton_event_register_handler(EV_SES_PRE_FINISHED, (triton_event_func)ev_ses_finished); + triton_event_register_handler(EV_SES_FINISHING, (triton_event_func)ev_ses_finished); #ifdef RADIUS if (triton_module_loaded("radius")) { triton_event_register_handler(EV_RADIUS_ACCESS_ACCEPT, (triton_event_func)ev_radius_access_accept); diff --git a/accel-pppd/include/events.h b/accel-pppd/include/events.h index 37dfa82c..42503a25 100644 --- a/accel-pppd/include/events.h +++ b/accel-pppd/include/events.h @@ -16,7 +16,6 @@ #define EV_SES_ACCT_START 10 #define EV_CONFIG_RELOAD 11 #define EV_SES_AUTH_FAILED 12 -#define EV_SES_PRE_FINISHED 13 #define EV_IP_CHANGED 100 #define EV_SHAPER 101 #define EV_MPPE_KEYS 102 diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index fee9334d..5f3bbcd9 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -185,9 +185,7 @@ exit_close_chan: static void destablish_ppp(struct ppp_t *ppp) { struct pppunit_cache *uc; - - triton_event_fire(EV_SES_PRE_FINISHED, ppp); - + triton_md_unregister_handler(&ppp->chan_hnd); triton_md_unregister_handler(&ppp->unit_hnd); @@ -442,7 +440,7 @@ void __export ppp_terminate(struct ap_session *ses, int hard) int s = 0; if (hard) { - destablish_ppp(ppp); + triton_context_call(ses->ctrl->ctx, (triton_event_func)destablish_ppp, ppp); return; } @@ -457,7 +455,7 @@ void __export ppp_terminate(struct ap_session *ses, int hard) if (s) return; - destablish_ppp(ppp); + triton_context_call(ses->ctrl->ctx, (triton_event_func)destablish_ppp, ppp); } void __export ppp_register_chan_handler(struct ppp_t *ppp,struct ppp_handler_t *h) diff --git a/accel-pppd/session.c b/accel-pppd/session.c index 51264f88..1fd0075c 100644 --- a/accel-pppd/session.c +++ b/accel-pppd/session.c @@ -125,10 +125,6 @@ void __export ap_session_finished(struct ap_session *ses) { ses->terminated = 1; - ap_session_read_stats(ses, NULL); - - triton_event_fire(EV_SES_PRE_FINISHED, ses); - pthread_rwlock_wrlock(&ses_lock); list_del(&ses->entry); pthread_rwlock_unlock(&ses_lock); @@ -206,10 +202,11 @@ void __export ap_session_terminate(struct ap_session *ses, int cause, int hard) log_ppp_debug("terminate\n"); ap_session_ifdown(ses); + ap_session_read_stats(ses, NULL); - triton_event_fire(EV_SES_FINISHING, ses); - ses->ctrl->terminate(ses, hard); + + triton_event_fire(EV_SES_FINISHING, ses); } void ap_shutdown_soft(void (*cb)(void)) |