peer_digest.cc File Reference
#include "squid.h"
#include "CacheDigest.h"
#include "CachePeer.h"
#include "event.h"
#include "FwdState.h"
#include "globals.h"
#include "HttpReply.h"
#include "HttpRequest.h"
#include "internal.h"
#include "MemObject.h"
#include "mime_header.h"
#include "neighbors.h"
#include "PeerDigest.h"
#include "SquidTime.h"
#include "Store.h"
#include "store_key_md5.h"
#include "StoreClient.h"
#include "tools.h"
#include "util.h"
Include dependency graph for peer_digest.cc:

Go to the source code of this file.

Macros

#define StoreDigestCBlockSize   sizeof(StoreDigestCBlock)
 
#define f2s(flag)   (pd->flags.flag ? "yes" : "no")
 
#define appendTime(tm)
 

Functions

static time_t peerDigestIncDelay (const PeerDigest *pd)
 
static time_t peerDigestNewDelay (const StoreEntry *e)
 
static void peerDigestSetCheck (PeerDigest *pd, time_t delay)
 
static void peerDigestRequest (PeerDigest *pd)
 
static int peerDigestFetchReply (void *, char *, ssize_t)
 
int peerDigestSwapInHeaders (void *, char *, ssize_t)
 
int peerDigestSwapInCBlock (void *, char *, ssize_t)
 
int peerDigestSwapInMask (void *, char *, ssize_t)
 
static int peerDigestFetchedEnough (DigestFetchState *fetch, char *buf, ssize_t size, const char *step_name)
 
static void peerDigestFetchStop (DigestFetchState *fetch, char *buf, const char *reason)
 
static void peerDigestFetchAbort (DigestFetchState *fetch, char *buf, const char *reason)
 
static void peerDigestReqFinish (DigestFetchState *fetch, char *buf, int, int, int, const char *reason, int err)
 
static void peerDigestPDFinish (DigestFetchState *fetch, int pcb_valid, int err)
 
static void peerDigestFetchFinish (DigestFetchState *fetch, int err)
 
static void peerDigestFetchSetStats (DigestFetchState *fetch)
 
static int peerDigestSetCBlock (PeerDigest *pd, const char *buf)
 
static int peerDigestUseful (const PeerDigest *pd)
 
void peerDigestCreate (CachePeer *p)
 
static void peerDigestDestroy (PeerDigest *pd)
 
void peerDigestNeeded (PeerDigest *pd)
 
void peerDigestNotePeerGone (PeerDigest *pd)
 
static void peerDigestCheck (void *data)
 
static void peerDigestHandleReply (void *data, StoreIOBuffer receivedData)
 
static int saneDiff (time_t diff)
 
void peerDigestStatsReport (const PeerDigest *pd, StoreEntry *e)
 

Variables

static EVH peerDigestCheck
 
static STCB peerDigestHandleReply
 
Version const CacheDigestVer = { 5, 3 }
 
static const time_t PeerDigestReqMinGap = 5 * 60
 
static const time_t GlobDigestReqMinGap = 1 * 60
 
static time_t pd_last_req_time = 0
 

Macro Definition Documentation

◆ appendTime

#define appendTime (   tm)
Value:
storeAppendPrintf(e, "%s\t %10ld\t %+d\t %+d\n", \
""#tm, (long int)pd->times.tm, \
saneDiff(pd->times.tm - squid_curtime), \
saneDiff(pd->times.tm - pd->times.initialized))
static int saneDiff(time_t diff)
time_t squid_curtime
Definition: stub_time.cc:17
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:875

Referenced by peerDigestStatsReport().

◆ f2s

#define f2s (   flag)    (pd->flags.flag ? "yes" : "no")

Referenced by peerDigestStatsReport().

◆ StoreDigestCBlockSize

#define StoreDigestCBlockSize   sizeof(StoreDigestCBlock)

Definition at line 58 of file peer_digest.cc.

Referenced by peerDigestSwapInCBlock().

Function Documentation

◆ peerDigestCheck()

◆ peerDigestCreate()

void peerDigestCreate ( CachePeer p)

Definition at line 130 of file peer_digest.cc.

References assert, cbdataReference, CachePeer::digest, and DigestFetchState::pd.

Referenced by parse_peer().

◆ peerDigestDestroy()

static void peerDigestDestroy ( PeerDigest pd)
static

◆ peerDigestFetchAbort()

static void peerDigestFetchAbort ( DigestFetchState fetch,
char *  buf,
const char *  reason 
)
static

◆ peerDigestFetchedEnough()

◆ peerDigestFetchFinish()

◆ peerDigestFetchReply()

◆ peerDigestFetchSetStats()

◆ peerDigestFetchStop()

static void peerDigestFetchStop ( DigestFetchState fetch,
char *  buf,
const char *  reason 
)
static

Definition at line 778 of file peer_digest.cc.

References assert, debugs, PeerDigest::host, DigestFetchState::pd, and peerDigestReqFinish().

Referenced by peerDigestFetchReply().

◆ peerDigestHandleReply()

◆ peerDigestIncDelay()

static time_t peerDigestIncDelay ( const PeerDigest pd)
static

Definition at line 209 of file peer_digest.cc.

References assert, PeerDigestReqMinGap, PeerDigest::retry_delay, and PeerDigest::times.

Referenced by peerDigestReqFinish().

◆ peerDigestNeeded()

◆ peerDigestNewDelay()

static time_t peerDigestNewDelay ( const StoreEntry e)
static

Definition at line 220 of file peer_digest.cc.

References assert, StoreEntry::expires, PeerDigestReqMinGap, and squid_curtime.

Referenced by peerDigestReqFinish().

◆ peerDigestNotePeerGone()

void peerDigestNotePeerGone ( PeerDigest pd)

◆ peerDigestPDFinish()

◆ peerDigestReqFinish()

◆ peerDigestRequest()

◆ peerDigestSetCBlock()

◆ peerDigestSetCheck()

static void peerDigestSetCheck ( PeerDigest pd,
time_t  delay 
)
static

◆ peerDigestStatsReport()

◆ peerDigestSwapInCBlock()

◆ peerDigestSwapInHeaders()

◆ peerDigestSwapInMask()

int peerDigestSwapInMask ( void *  data,
char *  buf,
ssize_t  size 
)

◆ peerDigestUseful()

static int peerDigestUseful ( const PeerDigest pd)
static

◆ saneDiff()

static int saneDiff ( time_t  diff)
static

Definition at line 1038 of file peer_digest.cc.

References squid_curtime.

Variable Documentation

◆ CacheDigestVer

Version const CacheDigestVer = { 5, 3 }

Definition at line 56 of file peer_digest.cc.

Referenced by storeDigestCBlockSwapOut().

◆ GlobDigestReqMinGap

const time_t GlobDigestReqMinGap = 1 * 60
static

Definition at line 63 of file peer_digest.cc.

Referenced by peerDigestCheck().

◆ pd_last_req_time

time_t pd_last_req_time = 0
static

Definition at line 67 of file peer_digest.cc.

Referenced by peerDigestCheck(), and peerDigestRequest().

◆ peerDigestCheck

EVH peerDigestCheck
static

Definition at line 38 of file peer_digest.cc.

Referenced by peerDigestSetCheck().

◆ peerDigestHandleReply

STCB peerDigestHandleReply
static

Definition at line 40 of file peer_digest.cc.

Referenced by peerDigestHandleReply(), and peerDigestRequest().

◆ PeerDigestReqMinGap

const time_t PeerDigestReqMinGap = 5 * 60
static

Definition at line 61 of file peer_digest.cc.

Referenced by peerDigestCheck(), peerDigestIncDelay(), and peerDigestNewDelay().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors