Text of code-reference.squid-cache.org › classCachePeer.html as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Squid Web Cache: CachePeer Class Reference

Squid Web Cache master Loading... Searching... No Matches Classes | Public Member Functions | Public Attributes | Private Member Functions | List of all members CachePeer Class Reference #include < CachePeer.h > Collaboration diagram for CachePeer: [ legend ] Classes struct icp_ Public Member Functions CachePeer (const char *hostname) ~CachePeer () void noteSuccess () reacts to a successful establishment of a connection to this cache_peer void noteFailure () reacts to a failed attempt to establish a connection to this cache_peer void rename (const char *) (re)configure cache_peer name=value time_t connectTimeout () const Security::FuturePeerContext * securityContext () Public Attributes u_int index = 0 n-th cache_peer directive, starting with 1 char * name = nullptr char * host = nullptr peer_t type = PEER_NONE Ip::Address in_addr struct { int pings_sent = 0 int pings_acked = 0 int fetches = 0 int rtt = 0 int ignored_replies = 0 int n_keepalives_sent = 0 int n_keepalives_recv = 0 time_t probe_start = 0 time_t last_query = 0 time_t last_reply = 0 time_t last_connect_failure = 0 time_t last_connect_probe = 0 int logged_state = PEER_ALIVE so we can print dead/revived msgs More... int conn_open = 0 current opened connections More... } stats struct CachePeer::icp_ icp struct { double version = 0.0 int counts [2] = {0, 0} unsigned short port = 0 } htcp unsigned short http_port = CACHE_HTTP_PORT NeighborTypeDomainList * typelist = nullptr acl_access * access = nullptr struct { bool proxy_only = false bool no_query = false bool background_ping = false bool no_digest = false bool default_parent = false bool roundrobin = false bool weighted_roundrobin = false bool mcast_responder = false bool closest_only = false bool htcp = false bool htcp_oldsquid = false bool htcp_no_clr = false bool htcp_no_purge_clr = false bool htcp_only_clr = false bool htcp_forward_clr = false bool no_netdb_exchange = false bool no_delay = false bool allow_miss = false bool carp = false struct { bool set = false bool scheme = false bool host = false bool port = false bool path = false bool params = false } carp_key bool userhash = false bool sourcehash = false bool originserver = false bool no_tproxy = false bool mcast_siblings = false bool auth_no_keytab = false } options int weight = 1 int basetime = 0 struct { double avg_n_members = 0.0 int n_times_counted = 0 int n_replies_expected = 0 int ttl = 0 int id = 0 struct { bool count_event_pending = false bool counting = false } flags } mcast PeerDigest * digest = nullptr char * digest_url = nullptr int tcp_up = 0 bool reprobe = false whether to do another TCP probe after current TCP probes Ip::Address addresses [10] int n_addresses = 0 int rr_count = 0 int testing_now = 0 struct { unsigned int hash = 0 double load_multiplier = 0.0 double load_factor = 0.0 normalized weight value More... } carp struct { unsigned int hash = 0 double load_multiplier = 0.0 double load_factor = 0.0 normalized weight value More... } userhash struct { unsigned int hash = 0 double load_multiplier = 0.0 double load_factor = 0.0 normalized weight value More... } sourcehash char * login = nullptr time_t connect_timeout_raw = 0 connect_timeout; use connectTimeout() instead! int connect_fail_limit = 0 int max_conn = 0 struct { PconnPool * pool = nullptr idle connection pool for this peer More...

CbcPointer < PeerPoolMgr > mgr pool manager More... int limit = 0 the limit itself More... bool waitingForClose = false a conn must close before we open a standby conn More... } standby optional "cache_peer standby=limit" feature char * domain = nullptr Forced domain. Security::PeerOptions secure security settings for peer connection Security::ContextPointer sslContext Security::FuturePeerContext tlsContext Security::SessionStatePointer sslSession int front_end_https = 0 0 - off, 1 - on, 2 - auto int connection_auth = 2 0 - off, 1 - on, 2 - auto PrecomputedCodeContextPointer probeCodeContext Private Member Functions CBDATA_CLASS ( CachePeer ) void countFailure () Detailed Description Definition at line 28 of file CachePeer.h .

Constructor & Destructor Documentation ◆ CachePeer() CachePeer::CachePeer ( const char * hostname ) explicit Definition at line 25 of file CachePeer.cc . References host , and Tolower() . ◆ ~CachePeer() CachePeer::~CachePeer ( ) Definition at line 34 of file CachePeer.cc . References access , aclDestroyAccessList() , PeerPoolMgr::Checkpoint() , digest , digest_url , domain , host , login , name , NeighborTypeDomainList::next , standby , typelist , and xfree .

Member Function Documentation ◆ CBDATA_CLASS() CachePeer::CBDATA_CLASS ( CachePeer ) private ◆ connectTimeout() time_t CachePeer::connectTimeout ( ) const Returns the effective connect timeout for the given peer Definition at line 120 of file CachePeer.cc . References Config , connect_timeout_raw , SquidConfig::peer_connect , and SquidConfig::Timeout . Referenced by Comm::Connection::connectTimeout() , PeerPoolMgr::handleOpenedConnection() , PeerPoolMgr::openNewConnection() , and peerProbeConnect() . ◆ countFailure() void CachePeer::countFailure ( ) private ◆ noteFailure() void CachePeer::noteFailure ( ) noteFailure() helper for handling failures attributed to this peer Definition at line 86 of file CachePeer.cc .

References assert , DBG_IMPORTANT , debugs , name , neighborTypeStr() , PEER_ALIVE , PEER_DEAD , squid_curtime , stats , and tcp_up . Referenced by NoteOutgoingConnectionFailure() , and peerProbeConnectDone() . ◆ noteSuccess() void CachePeer::noteSuccess ( ) Definition at line 71 of file CachePeer.cc . References connect_fail_limit , debugs , peerAlive() , and tcp_up . Referenced by NoteOutgoingConnectionSuccess() , and peerProbeConnectDone() . ◆ rename() void CachePeer::rename ( const char * newName ) Definition at line 110 of file CachePeer.cc .

References Here , name , xfree , and xstrdup . ◆ securityContext() Security::FuturePeerContext * CachePeer::securityContext ( ) TLS settings for communicating with this TLS cache_peer (if encryption is required; see secure.encryptTransport) or nil (otherwise) Definition at line 63 of file CachePeer.cc . References Security::PeerOptions::encryptTransport , secure , and tlsContext . Referenced by Security::BlindPeerConnector::peerContext() .

Member Data Documentation ◆ access acl_access * CachePeer::access = nullptr Definition at line 106 of file CachePeer.h . Referenced by ~CachePeer() , and peerAllowedToUse() . ◆ addresses Ip::Address CachePeer::addresses[10] Definition at line 179 of file CachePeer.h . Referenced by PeerPoolMgr::openNewConnection() , peerDNSConfigure() , and peerProbeConnect() . ◆ allow_miss bool CachePeer::allow_miss = false Definition at line 130 of file CachePeer.h .

Referenced by dump_peer_options() , and HttpStateData::sendRequest() . ◆ auth_no_keytab bool CachePeer::auth_no_keytab = false Definition at line 147 of file CachePeer.h . Referenced by HttpRequest::prepForPeering() . ◆ avg_n_members double CachePeer::avg_n_members = 0.0 Definition at line 154 of file CachePeer.h . Referenced by peerCountMcastPeersAbort() . ◆ background_ping bool CachePeer::background_ping = false Definition at line 111 of file CachePeer.h .

Referenced by dump_peer_options() , and peerWouldBePinged() . ◆ basetime int CachePeer::basetime = 0 Definition at line 151 of file CachePeer.h . Referenced by getWeightedRoundRobinParent() , PeerSelector::handleHtcpParentMiss() , and PeerSelector::handleIcpParentMiss() . ◆ carp [1/2] bool CachePeer::carp = false Definition at line 131 of file CachePeer.h . Referenced by dump_peer_options() . ◆ [struct] [2/2] struct { ... } CachePeer::carp ◆ [struct] struct { ... } CachePeer::carp_key ◆ closest_only bool CachePeer::closest_only = false Definition at line 117 of file CachePeer.h .

Referenced by dump_peer_options() , PeerSelector::handleHtcpParentMiss() , and PeerSelector::handleIcpParentMiss() . ◆ conn_open int CachePeer::conn_open = 0 Definition at line 86 of file

The rest of this page is on the live site.