store httpcode _before_ doing the FAILONERROR check so that getinfo works
authorDaniel Stenberg <daniel@haxx.se>
Tue, 22 May 2001 21:09:09 +0000 (21:09 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 22 May 2001 21:09:09 +0000 (21:09 +0000)
afterwards (bug #426442)

lib/transfer.c

index 3ee2bb8bda06770cc39ba8bd9ffc655555a93bc7..0374da0daff8a84f53e1a3f0dbbb71f62c777234 100644 (file)
@@ -466,6 +466,9 @@ Transfer(struct connectdata *c_conn)
                    or else we consiser this to be the body right away! */
                 if (2 == sscanf (p, " HTTP/1.%d %3d", &httpversion,
                                  &httpcode)) {
+                  data->progress.httpcode = httpcode;
+                  data->progress.httpversion = httpversion;
+
                   /* 404 -> URL not found! */
                   if (
                       ( ((data->bits.http_follow_location) &&
@@ -480,8 +483,6 @@ Transfer(struct connectdata *c_conn)
                     failf (data, "The requested file was not found");
                     return CURLE_HTTP_NOT_FOUND;
                   }
-                  data->progress.httpcode = httpcode;
-                  data->progress.httpversion = httpversion;
 
                   if(httpversion == 0)
                     /* Default action for HTTP/1.0 must be to close, unless