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)
 
static void peerDigestInit (PeerDigest *pd, CachePeer *p)
 
PeerDigestpeerDigestCreate (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

#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:904

Referenced by peerDigestStatsReport().

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

Referenced by peerDigestStatsReport().

#define StoreDigestCBlockSize   sizeof(StoreDigestCBlock)

Definition at line 58 of file peer_digest.cc.

Referenced by peerDigestSwapInCBlock().

Function Documentation

PeerDigest* peerDigestCreate ( CachePeer p)

Definition at line 133 of file peer_digest.cc.

References assert, cbdataReference, and peerDigestInit().

Referenced by parse_peer().

static void peerDigestDestroy ( PeerDigest pd)
static
static void peerDigestFetchAbort ( DigestFetchState fetch,
char *  buf,
const char *  reason 
)
static
static void peerDigestFetchStop ( DigestFetchState fetch,
char *  buf,
const char *  reason 
)
static

Definition at line 773 of file peer_digest.cc.

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

Referenced by peerDigestFetchReply().

static time_t peerDigestIncDelay ( const PeerDigest pd)
static

Definition at line 202 of file peer_digest.cc.

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

Referenced by peerDigestReqFinish().

static void peerDigestInit ( PeerDigest pd,
CachePeer p 
)
static
void peerDigestNeeded ( PeerDigest pd)
static time_t peerDigestNewDelay ( const StoreEntry e)
static

Definition at line 213 of file peer_digest.cc.

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

Referenced by peerDigestReqFinish().

void peerDigestNotePeerGone ( PeerDigest pd)
static void peerDigestSetCheck ( PeerDigest pd,
time_t  delay 
)
static
int peerDigestSwapInMask ( void *  data,
char *  buf,
ssize_t  size 
)
static int peerDigestUseful ( const PeerDigest pd)
static
static int saneDiff ( time_t  diff)
static

Definition at line 1034 of file peer_digest.cc.

References squid_curtime.

Variable Documentation

Version const CacheDigestVer = { 5, 3 }

Definition at line 56 of file peer_digest.cc.

Referenced by storeDigestCBlockSwapOut().

const time_t GlobDigestReqMinGap = 1 * 60
static

Definition at line 63 of file peer_digest.cc.

Referenced by peerDigestCheck().

time_t pd_last_req_time = 0
static

Definition at line 67 of file peer_digest.cc.

Referenced by peerDigestCheck(), and peerDigestRequest().

EVH peerDigestCheck
static

Definition at line 38 of file peer_digest.cc.

Referenced by peerDigestSetCheck().

STCB peerDigestHandleReply
static

Definition at line 40 of file peer_digest.cc.

Referenced by peerDigestHandleReply(), and peerDigestRequest().

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