summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/sstp/sstp.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/ctrl/sstp/sstp.c')
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index 4b154005..40c6ad91 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -169,6 +169,7 @@ static const char *conf_ifname;
static int conf_proxyproto = 0;
static int conf_sndbuf = 0;
static int conf_rcvbuf = 0;
+static int conf_session_timeout;
static int conf_hash_protocol = CERT_HASH_PROTOCOL_SHA1 | CERT_HASH_PROTOCOL_SHA256;
static struct hash_t conf_hash_sha1 = { .len = 0 };
@@ -2401,6 +2402,8 @@ static int sstp_connect(struct triton_md_handler_t *h)
conn->ppp.ses.dpv6_pool_name = _strdup(conf_dpv6_pool);
if (conf_ifname)
conn->ppp.ses.ifname_rename = _strdup(conf_ifname);
+ if (conf_session_timeout)
+ conn->ppp.ses.session_timeout = conf_session_timeout;
sockaddr_ntop(&addr, addr_buf, sizeof(addr_buf), FLAG_NOPORT);
conn->ctrl.calling_station_id = _strdup(addr_buf);
@@ -2412,12 +2415,12 @@ static int sstp_connect(struct triton_md_handler_t *h)
triton_context_register(&conn->ctx, &conn->ppp.ses);
triton_context_call(&conn->ctx, (triton_event_func)sstp_start, conn);
+ triton_timer_add(&conn->ctx, &conn->timeout_timer, 0);
triton_context_wakeup(&conn->ctx);
- __sync_add_and_fetch(&stat_starting, 1);
triton_event_fire(EV_CTRL_STARTING, &conn->ppp.ses);
- triton_timer_add(&conn->ctx, &conn->timeout_timer, 0);
+ __sync_add_and_fetch(&stat_starting, 1);
}
return 0;
@@ -2843,6 +2846,12 @@ static void load_config(void)
if (opt && atoi(opt) > 0)
conf_rcvbuf = atoi(opt);
+ opt = conf_get_opt("sstp", "session-timeout");
+ if (opt)
+ conf_session_timeout = atoi(opt);
+ else
+ conf_session_timeout = 0;
+
ipmode = (serv.addr.u.sa.sa_family == AF_INET && !conf_proxyproto) ?
iprange_check_activation() : -1;
switch (ipmode) {