From: Dan Lenski Date: Sat, 25 May 2019 05:41:19 +0000 (-0700) Subject: Report GP session lifetime X-Git-Tag: v8.04~45 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=af93f7fe5827ab0f1d2e75d04b1e568d8bf82a5a;p=users%2Fdwmw2%2Fopenconnect.git Report GP session lifetime OpenConnect doesn't have a mechanism to immediately stop trying to reconnect after the session expires. Server-forced session expiration "takes care of itself" when OpenConnect tries to reconnect repeatedly and fails, though it might be useful to save the expected expiration time somewhere to be able to report it in a more user-friendly fashion. Signed-off-by: Dan Lenski --- diff --git a/gpst.c b/gpst.c index 194ed365..390411d0 100644 --- a/gpst.c +++ b/gpst.c @@ -472,6 +472,8 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_ vpninfo->ip_info.netmask = add_option(vpninfo, "netmask", &s); else if (!xmlnode_get_val(xml_node, "mtu", &s)) vpninfo->ip_info.mtu = atoi(s); + else if (!xmlnode_get_val(xml_node, "lifetime", &s)) + vpn_progress(vpninfo, PRG_INFO, _("Session will expire after %d minutes.\n"), atoi(s)/60); else if (!xmlnode_get_val(xml_node, "disconnect-on-idle", &s)) { int sec = atoi(s); vpn_progress(vpninfo, PRG_INFO, _("Idle timeout is %d minutes.\n"), sec/60);