]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 24 Dec 2008 12:29:38 +0000 (01:29 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 24 Dec 2008 12:29:38 +0000 (01:29 +1300)
Bug 2542: squid fails to resume dowload (and breaks content) when any ICAP filter is attached

In the case the icap client is enabled, the
ServerStateData::handleMoreAdaptedBodyAvailable called to handle the incoming
data from the ICAP server. Inside this function a StoreIOBuffer created to pass
the data to the related StoreEntry.

The bug is that the offset passed to the StoreIOBuffer did not count the 206
response offsets.
This patch uses the ServerStateData::currentOffset to compute the correct
offset (which also used in the case the icap client is not enabled).

src/Server.cc

index e07f05db54c8a2948fbf799a9d3e7e26f3169be7..9f64ee2ce85d936123a18d4500b7c9a3143864e8 100644 (file)
@@ -683,7 +683,8 @@ ServerStateData::handleMoreAdaptedBodyAvailable()
 
     assert(entry);
     BodyPipeCheckout bpc(*adaptedBodySource);
-    const StoreIOBuffer ioBuf(&bpc.buf, bpc.offset);
+    const StoreIOBuffer ioBuf(&bpc.buf, currentOffset);
+    currentOffset += bpc.buf.size;
     entry->write(ioBuf);
     bpc.buf.consume(contentSize);
     bpc.checkIn();