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

typedef struct _Cache Cache

Definition at line 27 of file test_cache_digest.cc.

typedef struct _CacheEntry CacheEntry
typedef fr_result(* FI_READER)(FileIterator *fi)

Definition at line 62 of file test_cache_digest.cc.

typedef struct _FileIterator FileIterator

Definition at line 61 of file test_cache_digest.cc.

Enumeration Type Documentation

enum fr_result
Enumerator
frError 
frMore 
frEof 
frOk 

Definition at line 57 of file test_cache_digest.cc.

Function Documentation

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().

static void cacheDestroy ( Cache cache)
static
static CacheEntry* cacheEntryCreate ( const storeSwapLogData *  s)
static

Definition at line 188 of file test_cache_digest.cc.

References assert, _CacheEntry::key, _CacheEntry::key_arr, SQUID_MD5_DIGEST_LENGTH, and xcalloc.

Referenced by cacheStore().

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().

static void cacheFetch ( Cache cache,
const RawAccessLogEntry e 
)
static
static void cachePurge ( Cache cache,
storeSwapLogData *  s,
int  update_digest 
)
static
static void cacheReport ( Cache cache)
static
static void cacheResetDigest ( Cache cache)
static
static void cacheStore ( Cache cache,
storeSwapLogData *  s,
int  update_digest 
)
static
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().

static FileIterator* fileIteratorCreate ( const char *  fname,
FI_READER  reader 
)
static
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().

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().

static int usage ( const char *  prg_name)
static

Definition at line 517 of file test_cache_digest.cc.

Referenced by main().

Variable Documentation

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