summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-10 19:58:42 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-11 11:25:13 +0200
commitf21719e65a7286aca3267bbbc7fae891b175724f (patch)
tree297501e9f2b69779407ddb6f290360cc6e88569a
parenta533ca621567150732b58fc5176cd18b608f1f92 (diff)
downloadvyos-1x-f21719e65a7286aca3267bbbc7fae891b175724f.tar.gz
vyos-1x-f21719e65a7286aca3267bbbc7fae891b175724f.zip
vpn: sstp: T2008: cleanup thread_cnt generation
-rwxr-xr-xsrc/conf_mode/vpn_sstp.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/conf_mode/vpn_sstp.py b/src/conf_mode/vpn_sstp.py
index f1c65eef4..8bafa0e61 100755
--- a/src/conf_mode/vpn_sstp.py
+++ b/src/conf_mode/vpn_sstp.py
@@ -81,7 +81,7 @@ default_config_data = {
'ppp_echo_failure' : '',
'ppp_echo_interval' : '',
'ppp_echo_timeout' : '',
- 'thread_cnt' : ''
+ 'thread_cnt' : 1
}
def get_config():
@@ -93,10 +93,9 @@ def get_config():
conf.set_level(base_path)
- cpu = int(os.cpu_count()/2)
- if cpu < 1:
- cpu = 1
- sstp['thread_cnt'] = cpu
+ cpu = os.cpu_count()
+ if cpu > 1:
+ sstp['thread_cnt'] = int(cpu/2)
if conf.exists(['authentication', 'mode']):
sstp['auth_mode'] = conf.return_value(['authentication', 'mode'])