]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Report GP session lifetime
authorDan Lenski <dlenski@gmail.com>
Sat, 25 May 2019 05:41:19 +0000 (22:41 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Sun, 9 Jun 2019 23:51:05 +0000 (00:51 +0100)
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 <dlenski@gmail.com>
gpst.c

diff --git a/gpst.c b/gpst.c
index 194ed36561d4001ae66452dfaf0e4048a49bc847..390411d0a579363482bab97bed98ffff736106c1 100644 (file)
--- 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);