--------------------- PatchSet 1608 Date: 2005/08/25 21:16:24 Author: rousskov Branch: squid3-icap Tag: (none) Log: - Buffer and then flush store when packing into store entry to avoid lots of code being called for each micro-append. This is a little risky because the entry is supplied when packer is created but not when it is cleared. Thus, it is possible that the entry would be gone by the time the packer is cleared. Failure to clear the packer will result in a store entry left in the "buffered" state. Perhaps we should require store entry pointer for the packerClean call? Members: src/Packer.cc:1.2->1.2.14.1 Index: squid3/src/Packer.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Packer.cc,v retrieving revision 1.2 retrieving revision 1.2.14.1 diff -u -r1.2 -r1.2.14.1 --- squid3/src/Packer.cc 22 Feb 2003 03:14:30 -0000 1.2 +++ squid3/src/Packer.cc 25 Aug 2005 21:16:24 -0000 1.2.14.1 @@ -1,6 +1,6 @@ /* - * $Id: Packer.cc,v 1.2 2003/02/22 03:14:30 squidadm Exp $ + * $Id: Packer.cc,v 1.2.14.1 2005/08/25 21:16:24 rousskov Exp $ * * DEBUG: section 60 Packer: A uniform interface to store-like modules * AUTHOR: Alex Rousskov @@ -111,6 +111,7 @@ p->append = (append_f) store_append; p->vprintf = (vprintf_f) store_vprintf; p->real_handler = e; + storeBuffer(e); } /* init with this to accumulate data in MemBuf */ @@ -128,6 +129,9 @@ 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->vprintf = NULL;