From: wessels <> Date: Tue, 22 Nov 2005 05:55:53 +0000 (+0000) Subject: Use storeBuffer() and storeBufferFlush() later to avoid repeated X-Git-Tag: SQUID_3_0_PRE4~516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b89401f3b10bea4d7ee0905d7918e06d87740d7f;p=thirdparty%2Fsquid.git Use storeBuffer() and storeBufferFlush() later to avoid repeated callbacks for small additions to StoreEntry, i.e. when writing headers. --- diff --git a/src/Packer.cc b/src/Packer.cc index 220be898a6..d936db7bed 100644 --- a/src/Packer.cc +++ b/src/Packer.cc @@ -1,6 +1,6 @@ /* - * $Id: Packer.cc,v 1.19 2005/09/17 05:50:07 wessels Exp $ + * $Id: Packer.cc,v 1.20 2005/11/21 22:55:53 wessels Exp $ * * DEBUG: section 60 Packer: A uniform interface to store-like modules * AUTHOR: Alex Rousskov @@ -125,6 +125,7 @@ packerToStoreInit(Packer * p, StoreEntry * e) p->append = (append_f) store_append; p->packer_vprintf = (vprintf_f) store_vprintf; p->real_handler = e; + storeBuffer(e); } /* init with this to accumulate data in MemBuf */ @@ -142,6 +143,10 @@ void packerClean(Packer * p) { assert(p); + + if (p->append == (append_f) store_append && p->real_handler) + storeBufferFlush(static_cast(p->real_handler)); + /* it is not really necessary to do this, but, just in case... */ p->append = NULL; p->packer_vprintf = NULL;