test_cache_digest.cc File Reference
#include "squid.h"
#include "CacheDigest.h"
#include "store_key_md5.h"
#include <cerrno>
Include dependency graph for test_cache_digest.cc:

Go to the source code of this file.

Classes

struct  CacheQueryStats
 
struct  _Cache
 
struct  _CacheEntry
 
struct  RawAccessLogEntry
 
struct  _FileIterator
 

Typedefs

typedef struct _Cache Cache
 
typedef struct _CacheEntry CacheEntry
 
typedef struct _FileIterator FileIterator
 
typedef fr_result(* FI_READER) (FileIterator *fi)
 

Enumerations

enum  fr_result {
  frError = -2 ,
  frMore = -1 ,
  frEof = 0 ,
  frOk = 1
}
 

Functions

static HttpRequestMethod methodStrToId (const char *s)
 
static void fileIteratorAdvance (FileIterator *fi)
 
static FileIteratorfileIteratorCreate (const char *fname, FI_READER reader)
 
static void fileIteratorDestroy (FileIterator *fi)
 
static void fileIteratorSetCurTime (FileIterator *fi, time_t ct)
 
static CacheEntrycacheEntryCreate (const storeSwapLogData *s)
 
static void cacheEntryDestroy (CacheEntry *e)
 
static CachecacheCreate (const char *name)
 
static void cacheDestroy (Cache *cache)
 
static void cacheResetDigest (Cache *cache)
 
static void cacheQueryPeer (Cache *cache, const cache_key *key)
 
static void cacheQueryReport (Cache *cache, CacheQueryStats *stats)
 
static void cacheReport (Cache *cache)
 
static void cacheFetch (Cache *cache, const RawAccessLogEntry *e)
 
static fr_result swapStateReader (FileIterator *fi)
 
static fr_result accessLogReader (FileIterator *fi)
 
static void cachePurge (Cache *cache, storeSwapLogData *s, int update_digest)
 
static void cacheStore (Cache *cache, storeSwapLogData *s, int update_digest)
 
static void cacheUpdateStore (Cache *cache, storeSwapLogData *s, int update_digest)
 
static int usage (const char *prg_name)
 
int main (int argc, char *argv[])
 

Variables

static time_t cur_time = -1
 

Typedef Documentation

◆ Cache

typedef struct _Cache Cache

Definition at line 27 of file test_cache_digest.cc.

◆ CacheEntry

typedef struct _CacheEntry CacheEntry

◆ FI_READER

typedef fr_result(* FI_READER) (FileIterator *fi)

Definition at line 62 of file test_cache_digest.cc.

◆ FileIterator

typedef struct _FileIterator FileIterator

Definition at line 61 of file test_cache_digest.cc.

Enumeration Type Documentation

◆ fr_result

enum fr_result
Enumerator
frError 
frMore 
frEof 
frOk 

Definition at line 57 of file test_cache_digest.cc.

Function Documentation

◆ accessLogReader()

◆ cacheCreate()

static Cache * cacheCreate ( const char *  name)
static

Definition at line 208 of file test_cache_digest.cc.

References assert, _Cache::hash, hash_create(), _Cache::name, storeKeyHashCmp, storeKeyHashHash, and xcalloc().

Referenced by main().

◆ cacheDestroy()

static void cacheDestroy ( Cache cache)
static

◆ cacheEntryCreate()

static CacheEntry * cacheEntryCreate ( const storeSwapLogData *  s)
static

◆ cacheEntryDestroy()

static void cacheEntryDestroy ( CacheEntry e)
static

Definition at line 199 of file test_cache_digest.cc.

References assert, and xfree.

Referenced by cacheDestroy(), and cachePurge().

◆ cacheFetch()

static void cacheFetch ( Cache cache,
const RawAccessLogEntry e 
)
static

◆ cachePurge()

static void cachePurge ( Cache cache,
storeSwapLogData *  s,
int  update_digest 
)
static

◆ cacheQueryPeer()

◆ cacheQueryReport()

static void cacheQueryReport ( Cache cache,
CacheQueryStats stats 
)
static

Definition at line 311 of file test_cache_digest.cc.

References _Cache::name, _Cache::req_count, Ping::stats, and xpercentInt().

Referenced by main().

◆ cacheReport()

static void cacheReport ( Cache cache)
static

◆ cacheResetDigest()

static void cacheResetDigest ( Cache cache)
static

◆ cacheStore()

static void cacheStore ( Cache cache,
storeSwapLogData *  s,
int  update_digest 
)
static

◆ cacheUpdateStore()

static void cacheUpdateStore ( Cache cache,
storeSwapLogData *  s,
int  update_digest 
)
static

Definition at line 499 of file test_cache_digest.cc.

References assert, cachePurge(), cacheStore(), SWAP_LOG_ADD, and SWAP_LOG_DEL.

Referenced by main().

◆ fileIteratorAdvance()

◆ fileIteratorCreate()

static FileIterator * fileIteratorCreate ( const char *  fname,
FI_READER  reader 
)
static

◆ fileIteratorDestroy()

static void fileIteratorDestroy ( FileIterator fi)
static

Definition at line 127 of file test_cache_digest.cc.

References assert, _FileIterator::entry, _FileIterator::file, _FileIterator::fname, and xfree.

Referenced by main().

◆ fileIteratorSetCurTime()

static void fileIteratorSetCurTime ( FileIterator fi,
time_t  ct 
)
static

Definition at line 141 of file test_cache_digest.cc.

References assert, _FileIterator::inner_time, and _FileIterator::time_offset.

Referenced by main().

◆ main()

◆ methodStrToId()

◆ swapStateReader()

◆ usage()

static int usage ( const char *  prg_name)
static

Definition at line 517 of file test_cache_digest.cc.

Referenced by main().

Variable Documentation

◆ cur_time

time_t cur_time = -1
static

Definition at line 77 of file test_cache_digest.cc.

Referenced by main().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors