]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2024 fix: Do not optimize StoreEntry::write call away for zero-size
authorrousskov <>
Wed, 1 Aug 2007 10:18:08 +0000 (10:18 +0000)
committerrousskov <>
Wed, 1 Aug 2007 10:18:08 +0000 (10:18 +0000)
data because StoreEntry::write invokes client-side handlers for response
headers, even if there is no body data to write.

src/Server.cc

index 70b07f02a240cfc25fc58edb28a59f12927fc245..e0a28e01972fef46b147d823b8c6bf4501fe52fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: Server.cc,v 1.18 2007/08/01 04:16:00 rousskov Exp $
+ * $Id: Server.cc,v 1.19 2007/08/01 04:18:08 rousskov Exp $
  *
  * DEBUG:
  * AUTHOR: Duane Wessels
@@ -656,9 +656,7 @@ ServerStateData::addVirginReplyBody(const char *data, ssize_t len)
 void
 ServerStateData::storeReplyBody(const char *data, ssize_t len)
 {
-    if (!len)
-       return;
-
+    // write even if len is zero to push headers towards the client side
     entry->write (StoreIOBuffer(len, currentOffset, (char*)data));
 
     currentOffset += len;