Fix HTTP 1.0 body fetch.
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 3 Jan 2010 18:28:35 +0000 (18:28 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 3 Jan 2010 18:31:50 +0000 (18:31 +0000)
Not that we should ever really see one.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
http.c

diff --git a/http.c b/http.c
index db56d0c..a42e11a 100644 (file)
--- a/http.c
+++ b/http.c
@@ -191,10 +191,6 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result,
        if (*result == 100)
                goto cont;
 
-       /* Now the body, if there is one */
-       if (!bodylen)
-               goto fin;
-
        if (http10) {
                /* HTTP 1.0 response. Just eat all we can. */
                while (1) {
@@ -204,6 +200,11 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result,
                        done += i;
                }
        }
+
+       /* Now the body, if there is one */
+       if (!bodylen)
+               goto fin;
+
        /* If we were given Content-Length, it's nice and easy... */
        if (bodylen > 0) {
                while (done < bodylen) {