StoreMetaMD5.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 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
20 {
21  return len == SQUID_MD5_DIGEST_LENGTH;
22 }
23 
25 
26 bool
28 {
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 
const char * getMD5Text() const
Definition: store.cc:184
#define assert(EX)
Definition: assert.h:17
static int md5_mismatches
Definition: StoreMetaMD5.h:27
void * value
Definition: StoreMeta.h:133
bool checkConsistency(StoreEntry *) const
Definition: StoreMetaMD5.cc:27
bool validLength(int) const
Definition: StoreMetaMD5.cc:19
char getType() const
Definition: StoreMetaMD5.h:21
#define debugs(SECTION, LEVEL, CONTENT)
Definition: Debug.h:124
#define DBG_IMPORTANT
Definition: Debug.h:46
#define SQUID_MD5_DIGEST_LENGTH
Definition: md5.h:66
uint16_t flags
Definition: Store.h:208
int length
Definition: StoreMeta.h:132
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
int isPowTen(int count)
Definition: int.cc:16
#define EBIT_TEST(flag, bit)
Definition: defines.h:107

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors