squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
StoreMetaMD5.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
/* DEBUG: section 20 Storage Manager Swapfile Metadata */
10
11
#include "
squid.h
"
12
#include "
int.h
"
13
#include "
md5.h
"
14
#include "
MemObject.h
"
15
#include "
Store.h
"
16
#include "
StoreMetaMD5.h
"
17
18
bool
19
StoreMetaMD5::validLength
(
int
len)
const
20
{
21
return
len ==
SQUID_MD5_DIGEST_LENGTH
;
22
}
23
24
int
StoreMetaMD5::md5_mismatches
= 0;
25
26
bool
27
StoreMetaMD5::checkConsistency
(
StoreEntry
*e)
const
28
{
29
assert
(
getType
() ==
STORE_META_KEY_MD5
);
30
assert
(
length
==
SQUID_MD5_DIGEST_LENGTH
);
31
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
());
37
38
if
(
isPowTen
(++
md5_mismatches
))
39
debugs
(20,
DBG_IMPORTANT
,
"WARNING: "
<<
md5_mismatches
<<
" swapin MD5 mismatches"
);
40
41
return
false
;
42
}
43
44
return
true
;
45
}
46
StoreMetaMD5::validLength
bool validLength(int) const
Definition:
StoreMetaMD5.cc:19
int.h
KEY_PRIVATE
@ KEY_PRIVATE
Definition:
enums.h:102
isPowTen
int isPowTen(int count)
Definition:
int.cc:17
StoreEntry::flags
uint16_t flags
Definition:
Store.h:230
StoreMetaMD5::md5_mismatches
static int md5_mismatches
Definition:
StoreMetaMD5.h:27
SQUID_MD5_DIGEST_LENGTH
#define SQUID_MD5_DIGEST_LENGTH
Definition:
md5.h:66
md5.h
StoreMetaMD5::getType
char getType() const
Definition:
StoreMetaMD5.h:21
Store.h
EBIT_TEST
#define EBIT_TEST(flag, bit)
Definition:
defines.h:69
StoreMetaMD5::checkConsistency
bool checkConsistency(StoreEntry *) const
Definition:
StoreMetaMD5.cc:27
STORE_META_KEY_MD5
@ STORE_META_KEY_MD5
Definition:
StoreMeta.h:62
assert
#define assert(EX)
Definition:
assert.h:19
StoreMeta::length
int length
Definition:
StoreMeta.h:133
StoreMeta::value
void * value
Definition:
StoreMeta.h:134
StoreEntry
Definition:
Store.h:42
DBG_IMPORTANT
#define DBG_IMPORTANT
Definition:
Stream.h:41
MemObject.h
StoreMetaMD5.h
squid.h
debugs
#define debugs(SECTION, LEVEL, CONTENT)
Definition:
Stream.h:196
hash_link::key
void * key
Definition:
hash.h:19
StoreEntry::getMD5Text
const char * getMD5Text() const
Definition:
store.cc:204
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
jp
pl
...
full list
FTP Package Archive