From b912668e7cbde16e2251d88f3e99f35b785bce7f Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 1 Oct 2008 16:17:08 +0100 Subject: [PATCH] slight cleanup --- http.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/http.c b/http.c index c64c5e1..c9bc473 100644 --- a/http.c +++ b/http.c @@ -528,7 +528,8 @@ int obtain_cookie(struct anyconnect_info *vpninfo) } my_SSL_printf(vpninfo->https_ssl, "X-Transcend-Version: 1\r\n\r\n"); if (request_body_type) { - printf("Sending content: %s\n", request_body); + if (verbose) + printf("Sending content: %s\n", request_body); SSL_write(vpninfo->https_ssl, request_body, strlen(request_body)); } @@ -554,8 +555,12 @@ int obtain_cookie(struct anyconnect_info *vpninfo) vpninfo->hostname = strdup(host); free(vpninfo->redirect_url); vpninfo->redirect_url = NULL; + + /* Kill the existing connection, and a new one will happen */ SSL_free(vpninfo->https_ssl); vpninfo->https_ssl = NULL; + close(vpninfo->ssl_fd); + vpninfo->ssl_fd = -1; for (opt = vpninfo->cookies; opt; opt = next) { next = opt->next; @@ -584,6 +589,13 @@ int obtain_cookie(struct anyconnect_info *vpninfo) if (result > 0) { method = "POST"; request_body_type = "application/x-www-form-urlencoded"; + if (0) { + /* This doesn't make the second form work any better */ + SSL_free(vpninfo->https_ssl); + vpninfo->https_ssl = NULL; + close(vpninfo->ssl_fd); + vpninfo->ssl_fd = -1; + } goto retry; } else if (result < 0) return -EINVAL; -- 2.7.4