]> granicus.if.org Git - curl/commitdiff
HTTP: Don't attempt to needlessly decompress redirect body
authorHarry Sintonen <sintonen@iki.fi>
Thu, 26 Jul 2018 22:04:29 +0000 (01:04 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 31 Jul 2018 15:10:22 +0000 (17:10 +0200)
This change fixes a regression where redirect body would needlessly be
decompressed even though it was to be ignored anyway. As it happens this
causes secondary issues since there appears to be a bug in apache2 that
it in certain conditions generates a corrupt zlib response. The
regression was created by commit:
dbcced8e32b50c068ac297106f0502ee200a1ebd

Discovered-by: Harry Sintonen
Closes #2798

lib/transfer.c

index 435d3e1ec0190e81290a912a403dcbf288b17141..43f567c4f7bc67f54d471b3aac4e6457746a8f1e 100644 (file)
@@ -797,7 +797,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
                                            nread);
             }
           }
-          else
+          else if(!k->ignorebody)
             result = Curl_unencode_write(conn, k->writer_stack, k->str, nread);
         }
         k->badheader = HEADER_NORMAL; /* taken care of now */