From: rousskov <> Date: Wed, 1 Aug 2007 10:18:08 +0000 (+0000) Subject: Bug 2024 fix: Do not optimize StoreEntry::write call away for zero-size X-Git-Tag: SQUID_3_0_PRE7~140 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d1a172f69c6c0ef96c6ed0078e0ca4f935bb680;p=thirdparty%2Fsquid.git Bug 2024 fix: Do not optimize StoreEntry::write call away for zero-size data because StoreEntry::write invokes client-side handlers for response headers, even if there is no body data to write. --- diff --git a/src/Server.cc b/src/Server.cc index 70b07f02a2..e0a28e0197 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -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;