Skip to content

Commit

Permalink
Remove inappropriate exit() from library code
Browse files Browse the repository at this point in the history
It makes the auth-dialog very unhappy, if openconnect_obtain_cookie() calls
exit() from its thread when it gets cancelled. Distinctly suboptimal.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed May 13, 2012
1 parent 825da35 commit 3042cdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http.c
Expand Up @@ -267,7 +267,7 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result,
if (i < 0) {
vpn_progress(vpninfo, PRG_ERR,
_("Error fetching chunk header\n"));
exit(1);
return i;
}
chunklen = strtol(buf, NULL, 16);
if (!chunklen) {
Expand Down Expand Up @@ -694,7 +694,7 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
buflen = process_http_response(vpninfo, &result, NULL, &form_buf);
if (buflen < 0) {
/* We'll already have complained about whatever offended us */
exit(1);
return buflen;
}

if (result != 200 && vpninfo->redirect_url) {
Expand Down

0 comments on commit 3042cdb

Please sign in to comment.