follow redirect: ignore response-body on redirect even if compressed
authorDaniel Stenberg <daniel@haxx.se>
Fri, 14 May 2010 20:12:07 +0000 (22:12 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 May 2010 20:12:07 +0000 (22:12 +0200)
Sebastian V reported bug #3000056 identifying a problem with
redirect following. It showed that when curl followed redirects
it didn't properly ignore the response body of the 30X response
if that response was using compressed Content-Encoding!

(http://curl.haxx.se/bug/view.cgi?id=3000056)

CHANGES
RELEASE-NOTES
lib/content_encoding.c

diff --git a/CHANGES b/CHANGES
index 592beee..a2c0b64 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,12 @@
 
                                   Changelog
 
+Daniel Stenberg (14 May 2010)
+- Sebastian V reported bug #3000056 identifying a problem with redirect
+  following. It showed that when curl followed redirects it didn't properly
+  ignore the response body of the 30X response if that response was using
+  compressed Content-Encoding!
+  
 Daniel Stenberg (12 May 2010)
 - Howard Chu brought support for RTMP. This is powered by the underlying
   librtmp library. It supports a range of variations and "sub-protocols"
index 6f3b730..83b682e 100644 (file)
@@ -28,6 +28,7 @@ This release includes the following bugfixes:
  o SSL handshake timeout underflow in libcurl-NSS
  o multi interface missed storing connection time
  o broken CRL support in libcurl-NSS
+ o ignore response-body on redirect even if compressed
 
 This release includes the following known bugs:
 
index a44aad7..f8c9234 100644 (file)
@@ -103,7 +103,7 @@ inflate_stream(struct connectdata *conn,
     status = inflate(z, Z_SYNC_FLUSH);
     if(status == Z_OK || status == Z_STREAM_END) {
       allow_restart = 0;
-      if(DSIZ - z->avail_out) {
+      if((DSIZ - z->avail_out) && (!k->ignorebody)) {
         result = Curl_client_write(conn, CLIENTWRITE_BODY, decomp,
                                    DSIZ - z->avail_out);
         /* if !CURLE_OK, clean up, return */