From: hno <> Date: Sat, 20 May 2006 19:15:14 +0000 (+0000) Subject: Minor cleanup of the meta TLV format to not add the incorrect STORE_META_END X-Git-Tag: SQUID_3_0_PRE4~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c20988239326f763cfd5b773e694fe7b6cdc700;p=thirdparty%2Fsquid.git Minor cleanup of the meta TLV format to not add the incorrect STORE_META_END at the end of the list (list ends by it's size). STORE_META_END has changed a number of times over the history, and we have never cared about it but some external tools (i.e. purge) apparently beleives what they read in the docs.. --- diff --git a/doc/Programming-Guide/prog-guide.sgml b/doc/Programming-Guide/prog-guide.sgml index 0bdc84c6b3..636a63c8a8 100644 --- a/doc/Programming-Guide/prog-guide.sgml +++ b/doc/Programming-Guide/prog-guide.sgml @@ -2,7 +2,7 @@
Squid Programmers Guide Squid Developers -$Id: prog-guide.sgml,v 1.59 2006/04/22 05:28:26 robertc Exp $ +$Id: prog-guide.sgml,v 1.60 2006/05/20 13:15:14 hno Exp $ Squid is a WWW Cache application developed by the National Laboratory @@ -3605,14 +3605,22 @@ As of Squid-2.3, the following TYPES are defined (from +2GB objects. As STORE_META_STD except that the swap_file_sz + is a squid_file_sz (64-bit integer) instead of size_t. + diff --git a/src/StoreMetaUnpacker.cc b/src/StoreMetaUnpacker.cc index e1d648d561..9456a68153 100644 --- a/src/StoreMetaUnpacker.cc +++ b/src/StoreMetaUnpacker.cc @@ -1,6 +1,6 @@ /* - * $Id: StoreMetaUnpacker.cc,v 1.2 2003/02/21 22:50:06 robertc Exp $ + * $Id: StoreMetaUnpacker.cc,v 1.3 2006/05/20 13:15:14 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Unpacker * AUTHOR: Robert Collins @@ -51,7 +51,7 @@ StoreMetaUnpacker::isBufferSane() */ getBufferLength(); - if (*hdr_len <= MinimumBufferLength) + if (*hdr_len < MinimumBufferLength) return false; if (*hdr_len > buflen) @@ -112,7 +112,7 @@ StoreMetaUnpacker::doOneEntry() bool StoreMetaUnpacker::moreToProcess() const { - return *hdr_len - position - MinimumBufferLength > 0; + return *hdr_len - position - MinimumBufferLength >= 0; } StoreMeta * diff --git a/src/store_swapmeta.cc b/src/store_swapmeta.cc index fbacf6f9d9..2e9249ac97 100644 --- a/src/store_swapmeta.cc +++ b/src/store_swapmeta.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.cc,v 1.22 2003/08/04 22:14:42 robertc Exp $ + * $Id: store_swapmeta.cc,v 1.23 2006/05/20 13:15:14 hno Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -119,8 +119,6 @@ storeSwapMetaPack(tlv * tlv_list, int *length) for (t = tlv_list; t; t = t->next) buflen += sizeof(char) + sizeof(int) + t->length; - buflen++; /* STORE_META_END */ - buf = (char *)xmalloc(buflen); buf[j++] = (char) STORE_META_OK; @@ -137,7 +135,6 @@ storeSwapMetaPack(tlv * tlv_list, int *length) j += t->length; } - buf[j++] = (char) STORE_META_END; assert((int) j == buflen); *length = buflen; return buf;