Reinstate compatibility with test server hack
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Feb 2013 15:00:39 +0000 (15:00 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 4 Feb 2013 15:00:39 +0000 (15:00 +0000)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
http.c

diff --git a/http.c b/http.c
index c05340f..bcc4e98 100644 (file)
--- a/http.c
+++ b/http.c
@@ -388,6 +388,7 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result,
                if (!closeconn) {
                        vpn_progress(vpninfo, PRG_ERR,
                                     _("Cannot receive HTTP 1.0 body without closing connection\n"));
+                       openconnect_close_https(vpninfo, 0);
                        return -EINVAL;
                }
 
@@ -989,6 +990,10 @@ int openconnect_obtain_cookie(struct openconnect_info *vpninfo)
                        free(form_buf);
                        return result;
                }
+               if (form->action) {
+                       vpninfo->redirect_url = strdup(form->action);
+                       handle_redirect(vpninfo);
+               }
        }
 
        /* Step 4: Run the CSD trojan, if applicable */