mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
when debugging do not set memory limits
This commit is contained in:
16
src/main.c
16
src/main.c
@@ -401,13 +401,15 @@ static void drop_privileges(main_server_st* s)
|
||||
}
|
||||
|
||||
#define MAX_WORKER_MEM (4*1024*1024)
|
||||
rl.rlim_cur = MAX_WORKER_MEM;
|
||||
rl.rlim_max = MAX_WORKER_MEM;
|
||||
ret = setrlimit(RLIMIT_AS, &rl);
|
||||
if (ret < 0) {
|
||||
e = errno;
|
||||
mslog(s, NULL, LOG_ERR, "cannot enforce AS limit: %s\n",
|
||||
strerror(e));
|
||||
if (s->config->debug == 0) {
|
||||
rl.rlim_cur = MAX_WORKER_MEM;
|
||||
rl.rlim_max = MAX_WORKER_MEM;
|
||||
ret = setrlimit(RLIMIT_AS, &rl);
|
||||
if (ret < 0) {
|
||||
e = errno;
|
||||
mslog(s, NULL, LOG_ERR, "cannot enforce AS limit: %s\n",
|
||||
strerror(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user