]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Mark Fletcher provided an excellent bug report that identified a problem
authorDaniel Stenberg <daniel@haxx.se>
Sun, 3 Aug 2003 22:18:14 +0000 (22:18 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 3 Aug 2003 22:18:14 +0000 (22:18 +0000)
 with FOLLOWLOCATION and chunked transfer-encoding, as libcurl would not
 properly ignore the body contents of 3XX response that included the
 Location: header.

lib/http_chunks.c

index b0309fec896d460474076efab4b4e4c1b687dde4..ca3599ad0b0cac283403a549d09643bbae6fd058 100644 (file)
@@ -102,8 +102,9 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
                               size_t length,
                               size_t *wrote)
 {
-  CURLcode result;
+  CURLcode result=CURLE_OK;
   struct Curl_chunker *ch = &conn->proto.http->chunk;
+  struct Curl_transfer_keeper *k = &conn->keep;
   int piece;
   *wrote = 0; /* nothing yet */
 
@@ -180,8 +181,9 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
       switch (conn->keep.content_encoding) {
         case IDENTITY:
 #endif
-          result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
-                                     piece);
+          if(!k->ignorebody)
+            result = Curl_client_write(conn->data, CLIENTWRITE_BODY, datap,
+                                       piece);
 #ifdef HAVE_LIBZ
           break;