On Thu, 2018-06-21 at 04:37 +0000, Robin H. Johnson wrote:
> --- a/mainloop.c
> +++ b/mainloop.c
> @@ -307,7 +307,7 @@ int openconnect_mainloop(struct openconnect_info *vpninfo,
>  #endif
>         }
>  
> -       if (vpninfo->quit_reason && vpninfo->proto->vpn_close_session)
> +       if (vpninfo->quit_reason && vpninfo->proto->vpn_close_session && 
> vpninfo->logout)
>                 vpninfo->proto->vpn_close_session(vpninfo, 
> vpninfo->quit_reason);
>  
>         if (tun_is_up(vpninfo))

Hm... do we need the 'logout' flag in vpninfo at all? The same
behaviour was achievable with OC_CMD_DETACH (which happens when
openconnect receives SIGHUP), wasn't it?  Could you do it with a purely
local static 'nologout' in main.c and something like this...

--- a/main.c
+++ b/main.c
@@ -717,8 +717,11 @@ static void handle_signal(int sig)
 
        switch (sig) {
        case SIGINT:
-               cmd = OC_CMD_CANCEL;
-               break;
+               if (!nologout) {
+                       cmd = OC_CMD_CANCEL;
+                       break;
+               }
+               /* fall through */
        case SIGHUP:
                cmd = OC_CMD_DETACH;
                break;

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
openconnect-devel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/openconnect-devel

Reply via email to