]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/StoreMetaMD5.cc
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 20 Storage Manager Swapfile Metadata */
14 #include "MemObject.h"
16 #include "StoreMetaMD5.h"
19 StoreMetaMD5::validLength(int len
) const
21 return len
== SQUID_MD5_DIGEST_LENGTH
;
24 int StoreMetaMD5::md5_mismatches
= 0;
27 StoreMetaMD5::checkConsistency(StoreEntry
*e
) const
29 assert (getType() == STORE_META_KEY_MD5
);
30 assert(length
== SQUID_MD5_DIGEST_LENGTH
);
32 if (!EBIT_TEST(e
->flags
, KEY_PRIVATE
) &&
33 memcmp(value
, e
->key
, SQUID_MD5_DIGEST_LENGTH
)) {
34 debugs(20, 2, "storeClientReadHeader: swapin MD5 mismatch");
35 // debugs(20, 2, "\t" << storeKeyText((const cache_key *)value));
36 debugs(20, 2, "\t" << e
->getMD5Text());
38 if (isPowTen(++md5_mismatches
))
39 debugs(20, DBG_IMPORTANT
, "WARNING: " << md5_mismatches
<< " swapin MD5 mismatches");