neighbors.h File Reference
#include "anyp/forward.h"
#include "enums.h"
#include "ICP.h"
#include "lookup_t.h"
#include "typedefs.h"
Include dependency graph for neighbors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

CachePeergetFirstPeer (void)
 
CachePeergetFirstUpParent (PeerSelector *)
 
CachePeergetNextPeer (CachePeer *)
 
CachePeergetSingleParent (PeerSelector *)
 
int neighborsCount (PeerSelector *)
 
int neighborsUdpPing (HttpRequest *, StoreEntry *, IRCB *callback, PeerSelector *ps, int *exprep, int *timeout)
 
void neighborAddAcl (const char *, const char *)
 
void neighborsUdpAck (const cache_key *, icp_common_t *, const Ip::Address &)
 
void neighborAdd (const char *, const char *, int, int, int, int, int)
 
void neighbors_init (void)
 
void neighborsHtcpClear (StoreEntry *, const char *, HttpRequest *, const HttpRequestMethod &, htcp_clr_reason)
 
CachePeerpeerFindByName (const char *)
 
CachePeerpeerFindByNameAndPort (const char *, unsigned short)
 
CachePeergetDefaultParent (PeerSelector *)
 
CachePeergetRoundRobinParent (PeerSelector *)
 
CachePeergetWeightedRoundRobinParent (PeerSelector *)
 
void peerClearRRStart (void)
 
void peerClearRR (void)
 
lookup_t peerDigestLookup (CachePeer *p, PeerSelector *)
 
CachePeerneighborsDigestSelect (PeerSelector *)
 
void peerNoteDigestLookup (HttpRequest *request, CachePeer *p, lookup_t lookup)
 
void peerNoteDigestGone (CachePeer *p)
 
int neighborUp (const CachePeer *e)
 
const char * neighborTypeStr (const CachePeer *e)
 
peer_t neighborType (const CachePeer *, const AnyP::Uri &)
 
void peerConnectFailed (CachePeer *)
 
void peerConnectSucceded (CachePeer *)
 
void dump_peer_options (StoreEntry *, CachePeer *)
 
int peerHTTPOkay (const CachePeer *, PeerSelector *)
 
time_t peerConnectTimeout (const CachePeer *peer)
 
time_t positiveTimeout (const time_t timeout)
 
bool peerCanOpenMore (const CachePeer *p)
 Whether we can open new connections to the peer (e.g., despite max-conn) More...
 
bool peerHasConnAvailable (const CachePeer *p)
 Whether the peer has idle or standby connections that can be used now. More...
 
void peerConnClosed (CachePeer *p)
 Notifies peer of an associated connection closure. More...
 
CachePeerwhichPeer (const Ip::Address &from)
 

Function Documentation

CachePeer* getFirstPeer ( void  )

Definition at line 500 of file neighbors.cc.

References Config, and SquidConfig::peers.

Referenced by statPeerSelect().

CachePeer* getNextPeer ( CachePeer )

Definition at line 494 of file neighbors.cc.

References CachePeer::next.

Referenced by statPeerSelect().

CachePeer* getSingleParent ( PeerSelector )
void neighborAdd ( const char *  ,
const char *  ,
int  ,
int  ,
int  ,
int  ,
int   
)
void neighborAddAcl ( const char *  ,
const char *   
)
int neighborsCount ( PeerSelector )

Definition at line 267 of file neighbors.cc.

References Config, debugs, CachePeer::next, NULL, p, SquidConfig::peers, and peerWouldBePinged().

Referenced by peerSelectIcpPing().

int neighborsUdpPing ( HttpRequest ,
StoreEntry ,
IRCB callback,
PeerSelector ps,
int exprep,
int timeout 
)
const char* neighborTypeStr ( const CachePeer e)
bool peerCanOpenMore ( const CachePeer p)
void peerClearRR ( void  )

Called whenever the round-robin counters need to be reset to a sane state. So far those times are:

  • On startup and reconfigure - to set the counters to sane initial settings.
  • When a CachePeer has revived from dead, to prevent the revived CachePeer being flooded with requests which it has 'missed' during the down period.

Definition at line 440 of file neighbors.cc.

References Config, CachePeer::next, NULL, p, SquidConfig::peers, and CachePeer::rr_count.

Referenced by peerAlive(), and peerClearRRLoop().

void peerClearRRStart ( void  )

This gets called on startup and restart to kick off the CachePeer round-robin maintenance event. It ensures that no matter how many times its called no more than one event is scheduled.

Definition at line 423 of file neighbors.cc.

References NULL, and peerClearRRLoop().

Referenced by parse_peer().

time_t peerConnectTimeout ( const CachePeer peer)
Returns
the effective connect timeout for the given peer
the effective connect timeout for this peer

Definition at line 1182 of file neighbors.cc.

References Config, CachePeer::connect_timeout_raw, SquidConfig::peer_connect, and SquidConfig::Timeout.

Referenced by Comm::Connection::connectTimeout(), PeerPoolMgr::handleOpenedConnection(), PeerPoolMgr::openNewConnection(), and peerProbeConnect().

CachePeer* peerFindByName ( const char *  )
CachePeer* peerFindByNameAndPort ( const char *  ,
unsigned  short 
)
bool peerHasConnAvailable ( const CachePeer p)

Definition at line 226 of file neighbors.cc.

References PconnPool::count(), debugs, CachePeer::pool, and CachePeer::standby.

Referenced by peerHTTPOkay().

void peerNoteDigestGone ( CachePeer p)
void peerNoteDigestLookup ( HttpRequest request,
CachePeer p,
lookup_t  lookup 
)
time_t positiveTimeout ( const time_t  timeout)
Returns
max(1, timeout)

Definition at line 1189 of file neighbors.cc.

References max().

Referenced by FwdState::connectDone(), and PeerPoolMgr::handleOpenedConnection().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors