Skip to content

Commit

Permalink
Keep comments next to live code in fortinet.c
Browse files Browse the repository at this point in the history
In c0ca8c6, the fetch of the legacy/HTML
Fortinet config was preprocessor'ed out.  The comment about the subtle
behavior of unfetched redirects should be kept next to live code.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
  • Loading branch information
dlenski committed May 4, 2021
1 parent cefa0aa commit 98f477b
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions fortinet.c
Expand Up @@ -541,17 +541,8 @@ static int fortinet_configure(struct openconnect_info *vpninfo)
ret = do_https_request(vpninfo, "GET", NULL, NULL, &res_buf, 0);
if (ret < 0)
goto out;
else if (ret == 0) {
/* This is normally a redirect to /remote/login, which
* indicates that the auth session/cookie is no longer valid.
*
* XX: See do_https_request() for why ret==0 can only happen
* if there was a successful-but-unfetched redirect.
*/
invalid_cookie:
ret = -EPERM;
goto out;
}
else if (ret == 0)
goto invalid_cookie;
/* We don't care what it returned as long as it was successful */
free(res_buf);
res_buf = NULL;
Expand All @@ -567,6 +558,13 @@ static int fortinet_configure(struct openconnect_info *vpninfo)
_("Server doesn't support XML config format. Ancient HTML format is not currently implemented.\n"));
goto out;
} else if (ret == 0) {
/* This is normally a redirect to /remote/login, which
* indicates that the auth session/cookie is no longer valid.
*
* XX: See do_https_request() for why ret==0 can only happen
* if there was a successful-but-unfetched redirect.
*/
invalid_cookie:
ret = -EPERM;
goto out;
}
Expand Down

0 comments on commit 98f477b

Please sign in to comment.