ocserv: enforce a default auth timeout value

That is to prevent processes hanging on inactive sessions.
This commit is contained in:
Nikos Mavrogiannopoulos
2016-05-16 14:47:13 +02:00
parent 465389a82a
commit 7f65577fbd
2 changed files with 8 additions and 0 deletions

View File

@@ -912,6 +912,10 @@ size_t urlfw_size = 0;
READ_NUMERIC("session-timeout", config->session_timeout);
READ_NUMERIC("auth-timeout", config->auth_timeout);
if (config->auth_timeout == 0) {
config->auth_timeout = DEFAULT_AUTH_TIMEOUT_SECS;
}
READ_NUMERIC("idle-timeout", config->idle_timeout);
config->mobile_idle_timeout = -1;

View File

@@ -112,6 +112,10 @@ inline static const char *proto_to_str(fw_proto_t proto)
#define MIN_NO_COMPRESS_LIMIT 64
#define DEFAULT_NO_COMPRESS_LIMIT 256
/* The time after which a user will be forced to authenticate
* or disconnect. */
#define DEFAULT_AUTH_TIMEOUT_SECS 1800
/* The time after a disconnection the cookie is valid */
#define DEFAULT_COOKIE_RECON_TIMEOUT 120