Skip to content

Commit

Permalink
Propagate openconnect_open_https() return value
Browse files Browse the repository at this point in the history
Don't convert this into -EINVAL, particularly in do_https_request(), because
that causes us to make a second attempt to connect in non-XMLPOST mode. When
the failure happened on the *connection*, that's pointless.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 18, 2014
1 parent 7df7639 commit 010ff23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions http.c
Expand Up @@ -480,11 +480,11 @@ static int fetch_config(struct openconnect_info *vpninfo)
return 0;
}

if (openconnect_open_https(vpninfo)) {
if ((result = openconnect_open_https(vpninfo))) {
vpn_progress(vpninfo, PRG_ERR,
_("Failed to open HTTPS connection to %s\n"),
vpninfo->hostname);
return -EINVAL;
return result;
}

buf = buf_alloc();
Expand Down Expand Up @@ -944,12 +944,12 @@ static int do_https_request(struct openconnect_info *vpninfo, const char *method
rq_retry = 1;
} else {
rq_retry = 0;
if (openconnect_open_https(vpninfo)) {
if ((result = openconnect_open_https(vpninfo))) {
vpn_progress(vpninfo, PRG_ERR,
_("Failed to open HTTPS connection to %s\n"),
vpninfo->hostname);
buf_free(buf);
return -EINVAL;
return result;
}
}

Expand Down

0 comments on commit 010ff23

Please sign in to comment.