]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Keep comments next to live code in fortinet.c
authorDaniel Lenski <dlenski@gmail.com>
Tue, 4 May 2021 20:16:10 +0000 (13:16 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Tue, 4 May 2021 20:51:16 +0000 (13:51 -0700)
In c0ca8c632566bf423d3ac23b8b21ef353e399c33, 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>
fortinet.c

index 9ccea1cb06ced0e190848a4b4bc30edea7a9c6d9..f2db42582aa615d9cd62723bc6ab6d1da2fc51f6 100644 (file)
@@ -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;
@@ -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;
        }