Skip to content

Commit

Permalink
Allow OC_CMD_PAUSE to abort connection attempts
Browse files Browse the repository at this point in the history
Currently OC_CMD_PAUSE does not abort connection attempts in all cases.
One example of this can be seen in openssl.c:openconnect_open_https(),
which can get stuck forever if the socket hangs.

Change the helper function so that either OC_CMD_PAUSE or OC_CMD_CANCEL
exits the mainloop; the main difference is whether it is handled as a
temporary or permanent disconnection.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
cernekee authored and David Woodhouse committed May 6, 2016
1 parent 7c76735 commit aff243b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssl.c
Expand Up @@ -806,7 +806,7 @@ void check_cmd_fd(struct openconnect_info *vpninfo, fd_set *fds)
int is_cancel_pending(struct openconnect_info *vpninfo, fd_set *fds)
{
check_cmd_fd(vpninfo, fds);
return vpninfo->got_cancel_cmd;
return vpninfo->got_cancel_cmd || vpninfo->got_pause_cmd;
}

void poll_cmd_fd(struct openconnect_info *vpninfo, int timeout)
Expand Down

0 comments on commit aff243b

Please sign in to comment.