1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-01 12:54:07 +00:00

Limit sessions to 70% of maximum

This commit is contained in:
M66B 2017-04-04 10:07:33 +02:00
parent 078c2319fa
commit 643189728e

View file

@ -64,7 +64,7 @@ void *handle_events(void *a) {
if (getrlimit(RLIMIT_NOFILE, &rlim))
log_android(ANDROID_LOG_WARN, "getrlimit error %d: %s", errno, strerror(errno));
else {
maxsessions = (int) (rlim.rlim_cur * 75 / 100);
maxsessions = (int) (rlim.rlim_cur * 70 / 100);
log_android(ANDROID_LOG_WARN, "getrlimit soft %d hard %d max sessions %d",
rlim.rlim_cur, rlim.rlim_max, maxsessions);
}