diff options
author | xebd <xeb@mail.ru> | 2020-03-10 13:35:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 13:35:47 +0300 |
commit | 7afe0f075676219ab4b9e8dbfed294992e9f360b (patch) | |
tree | 4a7349449ac2072e52b441c813df42be4fec0ae1 /accel-pppd/ctrl/pptp/pptp.c | |
parent | 5db4429c75352b636cb8bb441216c4816ee8421f (diff) | |
parent | 58b41703427284ca849bed7d11087b76ef16a46f (diff) | |
download | accel-ppp-7afe0f075676219ab4b9e8dbfed294992e9f360b.tar.gz accel-ppp-7afe0f075676219ab4b9e8dbfed294992e9f360b.zip |
Merge pull request #121 from themiron/max-starting-cleanup
Add global [common]max-starting option
Diffstat (limited to 'accel-pppd/ctrl/pptp/pptp.c')
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index 1161da5a..3b90139f 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -55,7 +55,6 @@ struct pptp_conn_t struct ppp_t ppp; }; -static int conf_max_starting; static int conf_ppp_max_mtu = PPTP_MAX_MTU; static int conf_timeout = 5; static int conf_echo_interval = 0; @@ -652,13 +651,13 @@ static int pptp_connect(struct triton_md_handler_t *h) continue; } - if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions) { + if (conf_max_starting && ap_session_stat.starting >= conf_max_starting) { close(sock); continue; } - if (conf_max_starting > 0 && stat_starting >= conf_max_starting) { + + if (conf_max_sessions && ap_session_stat.active + ap_session_stat.starting >= conf_max_sessions) { close(sock); - log_warn("pptp: Count of starting sessions > conf_max_starting, droping connection...\n"); continue; } @@ -789,11 +788,6 @@ static void load_config(void) else conf_ppp_max_mtu = PPTP_MAX_MTU; - opt = conf_get_opt("pptp", "max-starting"); - if (opt) - conf_max_starting = atoi(opt); - else - conf_max_starting = 0; conf_mppe = MPPE_UNSET; opt = conf_get_opt("pptp", "mppe"); if (opt) { |