diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-01-24 23:56:52 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-01-24 23:56:52 +0400 |
commit | 35b55103979145284d63bc1db4ebd6e9d6666b34 (patch) | |
tree | e8fe1b4e3028236a0931e9f4becce21000a2b1c5 /accel-pppd | |
parent | 2491bb8266b5782aa32e0afcc81c98f7bc74eff7 (diff) | |
download | accel-ppp-35b55103979145284d63bc1db4ebd6e9d6666b34.tar.gz accel-ppp-35b55103979145284d63bc1db4ebd6e9d6666b34.zip |
session: fire EV_PRE_FINISHED
session: don't accept new sessions in shutdown mode
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/session.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/accel-pppd/session.c b/accel-pppd/session.c index fece089..51264f8 100644 --- a/accel-pppd/session.c +++ b/accel-pppd/session.c @@ -62,6 +62,9 @@ int __export ap_session_starting(struct ap_session *ses) struct ifreq ifr; struct rtnl_link_stats stats; + if (ap_shutdown) + return -1; + if (ses->ifindex == -1) { memset(&ifr, 0, sizeof(ifr)); strcpy(ifr.ifr_name, ses->ifname); @@ -103,6 +106,9 @@ int __export ap_session_starting(struct ap_session *ses) void __export ap_session_activate(struct ap_session *ses) { + if (ap_shutdown) + return; + ap_session_ifup(ses); ses->state = AP_STATE_ACTIVE; @@ -119,6 +125,10 @@ 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); |