peer_digest.cc File Reference
#include "squid.h"
#include "base/IoManip.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 "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 *data, char *buf, ssize_t size)
 handle HTTP response headers in the initial storeClientCopy() response More...
 
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 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))
time_t squid_curtime
Definition: stub_libtime.cc:20
static int saneDiff(time_t diff)
Definition: peer_digest.cc:926
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:841

◆ f2s

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

◆ StoreDigestCBlockSize

#define StoreDigestCBlockSize   sizeof(StoreDigestCBlock)

Definition at line 57 of file peer_digest.cc.

Function Documentation

◆ peerDigestCheck()

◆ 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 666 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 141 of file peer_digest.cc.

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

Referenced by peerDigestReqFinish().

◆ peerDigestNeeded()

void peerDigestNeeded ( PeerDigest pd)

◆ peerDigestNewDelay()

static time_t peerDigestNewDelay ( const StoreEntry e)
static

Definition at line 152 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()

◆ 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 926 of file peer_digest.cc.

References squid_curtime.

Variable Documentation

◆ CacheDigestVer

Version const CacheDigestVer = { 5, 3 }

Definition at line 55 of file peer_digest.cc.

Referenced by peerDigestSetCBlock(), and storeDigestCBlockSwapOut().

◆ GlobDigestReqMinGap

const time_t GlobDigestReqMinGap = 1 * 60
static

Definition at line 62 of file peer_digest.cc.

Referenced by peerDigestCheck().

◆ pd_last_req_time

time_t pd_last_req_time = 0
static

Definition at line 66 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 PeerDigest::~PeerDigest(), and 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 60 of file peer_digest.cc.

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors