#include "squid.h"
#include "acl/FilledChecklist.h"
#include "anyp/PortCfg.h"
#include "base/EnumIterator.h"
#include "CacheDigest.h"
#include "CachePeer.h"
#include "comm/Connection.h"
#include "comm/ConnOpener.h"
#include "event.h"
#include "FwdState.h"
#include "globals.h"
#include "htcp.h"
#include "HttpRequest.h"
#include "icmp/net_db.h"
#include "ICP.h"
#include "int.h"
#include "ip/Address.h"
#include "ip/tools.h"
#include "ipcache.h"
#include "MemObject.h"
#include "mgr/Registration.h"
#include "multicast.h"
#include "neighbors.h"
#include "NeighborTypeDomainList.h"
#include "pconn.h"
#include "PeerDigest.h"
#include "PeerPoolMgr.h"
#include "PeerSelectState.h"
#include "RequestFlags.h"
#include "SquidConfig.h"
#include "SquidMath.h"
#include "SquidTime.h"
#include "stat.h"
#include "Store.h"
#include "store_key_md5.h"
#include "tools.h"

Go to the source code of this file.
Macros | |
#define | MCAST_COUNT_RATE 900 |
Variables | |
static IPH | peerDNSConfigure |
static CNCB | peerProbeConnectDone |
static IRCB | peerCountHandleIcpReply |
static OBJH | neighborDumpPeers |
static OBJH | neighborDumpNonPeers |
static unsigned short | echo_port |
static int | NLateReplies = 0 |
static CachePeer * | first_ping = NULL |
static CachePeer * | non_peers = NULL |
Macro Definition Documentation
◆ MCAST_COUNT_RATE
#define MCAST_COUNT_RATE 900 |
Definition at line 49 of file neighbors.cc.
Function Documentation
◆ dump_peer_options()
void dump_peer_options | ( | StoreEntry * | sentry, |
CachePeer * | p | ||
) |
Definition at line 1511 of file neighbors.cc.
References CachePeer::allow_miss, CachePeer::background_ping, CachePeer::carp, CachePeer::closest_only, CachePeer::connect_fail_limit, CachePeer::connect_timeout_raw, CachePeer::connection_auth, CachePeer::default_parent, CachePeer::digest_url, CachePeer::domain, Security::PeerOptions::dumpCfg(), CachePeer::htcp, CachePeer::htcp_no_clr, CachePeer::htcp_no_purge_clr, CachePeer::htcp_oldsquid, CachePeer::htcp_only_clr, CachePeer::limit, CachePeer::login, CachePeer::max_conn, CachePeer::mcast, CachePeer::mcast_responder, CachePeer::mcast_siblings, CachePeer::no_delay, CachePeer::no_digest, CachePeer::no_netdb_exchange, CachePeer::no_query, CachePeer::no_tproxy, CachePeer::options, CachePeer::originserver, PEER_TCP_MAGIC_COUNT, CachePeer::proxy_only, CachePeer::roundrobin, CachePeer::secure, CachePeer::sourcehash, CachePeer::standby, storeAppendPrintf(), CachePeer::ttl, CachePeer::userhash, CachePeer::weight, and CachePeer::weighted_roundrobin.
Referenced by dump_peer(), and dump_peers().
◆ dump_peers()
|
static |
Definition at line 1640 of file neighbors.cc.
References assert, dump_peer_options(), Time::FormatHttpd(), icp_opcode_str, Math::intPercent(), MAX_IPSTRLEN, neighborTypeStr(), neighborUp(), CachePeer::next, NULL, squid_curtime, and storeAppendPrintf().
Referenced by neighborDumpNonPeers(), and neighborDumpPeers().
◆ getDefaultParent()
CachePeer* getDefaultParent | ( | PeerSelector * | ps | ) |
Definition at line 474 of file neighbors.cc.
References assert, Config, debugs, CachePeer::default_parent, CachePeer::host, neighborType(), CachePeer::next, NULL, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, PeerSelector::request, request(), and _request::url.
Referenced by PeerSelector::selectAllParents(), and PeerSelector::selectSomeParent().
◆ getFirstPeer()
CachePeer* getFirstPeer | ( | void | ) |
Definition at line 507 of file neighbors.cc.
References Config, and SquidConfig::peers.
Referenced by statPeerSelect().
◆ getFirstUpParent()
CachePeer* getFirstUpParent | ( | PeerSelector * | ps | ) |
Definition at line 288 of file neighbors.cc.
References assert, Config, debugs, CachePeer::host, neighborType(), neighborUp(), CachePeer::next, NULL, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, PeerSelector::request, request(), and _request::url.
Referenced by PeerSelector::selectSomeParent().
◆ getNextPeer()
Definition at line 501 of file neighbors.cc.
References CachePeer::next.
Referenced by statPeerSelect().
◆ getRoundRobinParent()
CachePeer* getRoundRobinParent | ( | PeerSelector * | ps | ) |
Definition at line 313 of file neighbors.cc.
References assert, Config, debugs, HERE(), CachePeer::host, neighborType(), CachePeer::next, NULL, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, PeerSelector::request, request(), CachePeer::roundrobin, CachePeer::rr_count, _request::url, and CachePeer::weight.
Referenced by PeerSelector::selectSomeParent().
◆ getWeightedRoundRobinParent()
CachePeer* getWeightedRoundRobinParent | ( | PeerSelector * | ps | ) |
Definition at line 355 of file neighbors.cc.
References assert, CachePeer::basetime, Config, debugs, CachePeer::host, neighborType(), CachePeer::next, NULL, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, PeerSelector::request, request(), CachePeer::rr_count, CachePeer::rtt, CachePeer::stats, _request::url, CachePeer::weight, and CachePeer::weighted_roundrobin.
Referenced by PeerSelector::selectSomeParent().
◆ ignoreMulticastReply()
|
static |
Definition at line 981 of file neighbors.cc.
References CachePeer::mcast_responder, NULL, CachePeer::options, and peerHTTPOkay().
Referenced by neighborsHtcpReply(), and neighborsUdpAck().
◆ neighborAlive()
|
static |
Definition at line 882 of file neighbors.cc.
References CachePeer::icp_::counts, CachePeer::icp, ICP_END, int, icp_common_t::opcode, peerAlive(), CachePeer::pings_acked, CachePeer::stats, CachePeer::icp_::version, and icp_common_t::version.
Referenced by neighborsUdpAck().
◆ neighborAliveHtcp()
|
static |
Definition at line 919 of file neighbors.cc.
References CachePeer::counts, HtcpReplyData::hit, CachePeer::htcp, peerAlive(), CachePeer::pings_acked, CachePeer::stats, CachePeer::version, and HtcpReplyData::version.
Referenced by neighborsHtcpReply().
◆ neighborCountIgnored()
|
static |
Definition at line 930 of file neighbors.cc.
References CachePeer::ignored_replies, NLateReplies, NULL, and CachePeer::stats.
Referenced by neighborsHtcpReply(), and neighborsUdpAck().
◆ neighborDumpNonPeers()
|
static |
Definition at line 1505 of file neighbors.cc.
References dump_peers(), and non_peers.
◆ neighborDumpPeers()
|
static |
Definition at line 1499 of file neighbors.cc.
References Config, dump_peers(), and SquidConfig::peers.
◆ neighborIgnoreNonPeer()
|
static |
Definition at line 943 of file neighbors.cc.
References CachePeer::icp_::counts, DBG_IMPORTANT, debugs, CachePeer::host, CachePeer::icp, CachePeer::ignored_replies, CachePeer::in_addr, isPowTen(), MAX_IPSTRLEN, CachePeer::next, non_peers, NULL, PEER_NONE, CachePeer::icp_::port, Ip::Address::port(), CachePeer::stats, Ip::Address::toStr(), and CachePeer::type.
Referenced by neighborsUdpAck().
◆ neighborRemove()
|
static |
Definition at line 513 of file neighbors.cc.
References Config, first_ping, CachePeer::next, SquidConfig::npeers, NULL, and SquidConfig::peers.
Referenced by neighbors_init(), and neighborsUdpAck().
◆ neighbors_init()
void neighbors_init | ( | void | ) |
Definition at line 554 of file neighbors.cc.
References Config, DBG_IMPORTANT, debugs, echo_port, Debug::Extra(), first_ping, getMyHostname(), getservbyname(), CachePeer::host, CachePeer::http_port, HttpPortList, CachePeer::icp, icpIncomingConn, Comm::IsConnOpen(), neighborRemove(), neighborsRegisterWithCacheManager(), neighborTypeStr(), CachePeer::next, NULL, peerRefreshDNS(), SquidConfig::peers, CachePeer::icp_::port, and servent::s_port.
Referenced by mainInitialize(), and mainReconfigureFinish().
◆ neighborsCount()
int neighborsCount | ( | PeerSelector * | ps | ) |
Definition at line 273 of file neighbors.cc.
References Config, debugs, CachePeer::next, NULL, SquidConfig::peers, and peerWouldBePinged().
Referenced by peerSelectIcpPing().
◆ neighborsDigestSelect()
CachePeer* neighborsDigestSelect | ( | PeerSelector * | ps | ) |
Definition at line 803 of file neighbors.cc.
References assert, Config, debugs, first_ping, CachePeer::host, LOOKUP_HIT, LOOKUP_MISS, LOOKUP_NONE, netdbHostRtt(), CachePeer::next, SquidConfig::npeers, NULL, peerDigestLookup(), peerNoteDigestLookup(), SquidConfig::peers, PeerSelector::request, request(), and storeKeyPublicByRequest().
Referenced by PeerSelector::selectSomeNeighbor().
◆ neighborsHtcpClear()
void neighborsHtcpClear | ( | StoreEntry * | e, |
HttpRequest * | req, | ||
const HttpRequestMethod & | method, | ||
htcp_clr_reason | reason | ||
) |
Definition at line 1807 of file neighbors.cc.
References buf, Config, debugs, CachePeer::htcp, HTCP_CLR_PURGE, CachePeer::htcp_no_clr, CachePeer::htcp_no_purge_clr, htcpClear(), CachePeer::in_addr, method, CachePeer::next, CachePeer::options, SquidConfig::peers, and Ip::Address::toUrl().
Referenced by httpMaybeRemovePublic(), purgeEntriesByUrl(), and clientReplyContext::purgeEntry().
◆ neighborsHtcpReply()
void neighborsHtcpReply | ( | const cache_key * | key, |
HtcpReplyData * | htcp, | ||
const Ip::Address & | from | ||
) |
Definition at line 1733 of file neighbors.cc.
References DBG_IMPORTANT, debugs, EBIT_TEST, ENTRY_DISPATCHED, Store::Controller::findCallbackXXX(), StoreEntry::flags, HtcpReplyData::hit, ignoreMulticastReply(), MemObject::ircb_data, StoreEntry::locked(), StoreEntry::mem_obj, neighborAliveHtcp(), neighborCountIgnored(), neighborType(), neighborUpdateRtt(), NULL, PEER_NONE, MemObject::ping_reply_callback, StoreEntry::ping_status, PING_WAITING, AnyP::PROTO_HTCP, MemObject::request, Store::Root(), storeKeyText(), HttpRequest::url, and whichPeer().
Referenced by htcpHandleTstResponse().
◆ neighborsRegisterWithCacheManager()
|
static |
Definition at line 540 of file neighbors.cc.
References icpIncomingConn, Comm::IsConnOpen(), neighborDumpNonPeers, neighborDumpPeers, and Mgr::RegisterAction().
Referenced by neighbors_init().
◆ neighborsUdpAck()
void neighborsUdpAck | ( | const cache_key * | key, |
icp_common_t * | header, | ||
const Ip::Address & | from | ||
) |
I should attach these records to the entry. We take the first hit we get our wait until everyone misses. The timeout handler call needs to nip this shopping list or call one of the misses.
If a hit process is already started, then sobeit
Definition at line 1003 of file neighbors.cc.
References CachePeer::icp_::counts, DBG_CRITICAL, DBG_IMPORTANT, debug_trap(), debugs, EBIT_TEST, ENTRY_DISPATCHED, StoreEntry::flags, CachePeer::host, CachePeer::icp, ICP_DECHO, ICP_DENIED, ICP_END, ICP_HIT, ICP_MISS, ICP_MISS_NOFETCH, icp_opcode_str, ICP_SECHO, ignoreMulticastReply(), MemObject::ircb_data, StoreEntry::locked(), StoreEntry::mem_obj, neighborAlive(), neighborCountIgnored(), neighborIgnoreNonPeer(), neighborRemove(), neighborType(), neighborUpdateRtt(), NULL, icp_common_t::opcode, PEER_NONE, PEER_SIBLING, MemObject::ping_reply_callback, StoreEntry::ping_status, PING_WAITING, CachePeer::pings_acked, AnyP::PROTO_ICP, MemObject::request, Store::Root(), CachePeer::stats, storeKeyText(), HttpRequest::url, and whichPeer().
Referenced by icp_common_t::handleReply().
◆ neighborsUdpPing()
int neighborsUdpPing | ( | HttpRequest * | request, |
StoreEntry * | entry, | ||
IRCB * | callback, | ||
PeerSelector * | ps, | ||
int * | exprep, | ||
int * | timeout | ||
) |
Definition at line 595 of file neighbors.cc.
References assert, callback, Config, current_time, DBG_CRITICAL, DBG_IMPORTANT, debugs, echo_port, first_ping, StoreEntry::getMD5Text(), StoreEntry::hasDisk(), CachePeer::host, CachePeer::htcp, SquidConfig::htcp, CachePeer::htcp_only_clr, htcpQuery(), CachePeer::icp, SquidConfig::icp, ICP_DECHO, ICP_FLAG_SRC_RTT, ICP_QUERY, SquidConfig::icp_query, SquidConfig::icp_query_max, SquidConfig::icp_query_min, ICP_VERSION_2, icpCreateAndSend(), icpOutgoingConn, icpSetCacheKey(), CachePeer::in_addr, MemObject::ircb_data, Comm::IsConnOpen(), hash_link::key, CachePeer::last_query, CachePeer::logged_state, CachePeer::mcast, mcastSetTtl(), StoreEntry::mem_obj, CachePeer::n_replies_expected, CachePeer::name, neighborType(), neighborTypeStr(), neighborUp(), CachePeer::next, SquidConfig::npeers, NULL, SquidConfig::onoff, CachePeer::options, PEER_ALIVE, PEER_DEAD, PEER_MULTICAST, PEER_PARENT, SquidConfig::peers, peerWouldBePinged(), MemObject::ping_reply_callback, CachePeer::pings_sent, CachePeer::icp_::port, SquidConfig::Port, CachePeer::probe_start, SquidConfig::query_icmp, request(), CachePeer::rtt, squid_curtime, MemObject::start_ping, CachePeer::stats, SquidConfig::Timeout, CachePeer::ttl, CachePeer::type, StoreEntry::url(), _request::url, and CachePeer::icp_::version.
Referenced by PeerSelector::selectSomeNeighbor().
◆ neighborType()
Definition at line 115 of file neighbors.cc.
References NeighborTypeDomainList::domain, AnyP::Uri::host(), matchDomainName(), CachePeer::mcast_siblings, NeighborTypeDomainList::next, NULL, CachePeer::options, PEER_MULTICAST, PEER_NONE, PEER_SIBLING, CachePeer::type, NeighborTypeDomainList::type, and CachePeer::typelist.
Referenced by getDefaultParent(), getFirstUpParent(), getRoundRobinParent(), getWeightedRoundRobinParent(), neighborsHtcpReply(), neighborsUdpAck(), neighborsUdpPing(), netdbClosestParent(), peerAllowedToUse(), PeerSelector::selectAllParents(), PeerSelector::selectSomeNeighbor(), and HttpStateData::sendRequest().
◆ neighborTypeStr()
const char* neighborTypeStr | ( | const CachePeer * | p | ) |
Definition at line 81 of file neighbors.cc.
References PEER_MULTICAST, PEER_NONE, PEER_SIBLING, and CachePeer::type.
Referenced by dump_peer(), dump_peers(), neighbors_init(), neighborsUdpPing(), peerAlive(), peerConnectFailedSilent(), and peerDNSConfigure().
◆ neighborUp()
Definition at line 1155 of file neighbors.cc.
References Config, SquidConfig::deadPeer, debugs, CachePeer::host, CachePeer::in_addr, CachePeer::n_addresses, CachePeer::no_query, CachePeer::options, peerProbeConnect(), CachePeer::probe_start, squid_curtime, CachePeer::stats, CachePeer::tcp_up, and SquidConfig::Timeout.
Referenced by dump_peers(), getFirstUpParent(), neighborsUdpPing(), PeerPoolMgr::openNewConnection(), peerHTTPOkay(), peerWouldBePinged(), and snmp_meshPtblFn().
◆ neighborUpdateRtt()
Definition at line 894 of file neighbors.cc.
References current_time, Math::intAverage(), CachePeer::options, CachePeer::pings_acked, CachePeer::rtt, RTT_AV_FACTOR, RTT_BACKGROUND_AV_FACTOR, MemObject::start_ping, CachePeer::stats, tvSubMsec(), and CachePeer::weighted_roundrobin.
Referenced by neighborsHtcpReply(), and neighborsUdpAck().
◆ peerAlive()
void peerAlive | ( | CachePeer * | p | ) |
Perform all actions when a CachePeer is detected revived.
Definition at line 459 of file neighbors.cc.
References PeerPoolMgr::Checkpoint(), DBG_IMPORTANT, debugs, CachePeer::last_reply, CachePeer::logged_state, CachePeer::mgr, CachePeer::name, neighborTypeStr(), PEER_ALIVE, PEER_DEAD, peerClearRR(), CachePeer::probe_start, squid_curtime, CachePeer::standby, CachePeer::stats, CachePeer::tcp_up, and CbcPointer< Cbc >::valid().
Referenced by neighborAlive(), neighborAliveHtcp(), and peerConnectSucceded().
◆ peerAllowedToUse()
bool peerAllowedToUse | ( | const CachePeer * | p, |
PeerSelector * | ps | ||
) |
- Returns
- Whether it is appropriate to fetch REQUEST from PEER.
Definition at line 138 of file neighbors.cc.
References CachePeer::access, ACLFilledChecklist::al, PeerSelector::al, Acl::Answer::allowed(), assert, debugs, ACLChecklist::fastCheck(), RefCount< C >::getRaw(), CachePeer::http_port, HTTPMSGLOCK(), CachePeer::mcast_siblings, _request::method, Http::METHOD_CONNECT, CachePeer::name, neighborType(), NULL, CachePeer::options, CachePeer::originserver, PEER_MULTICAST, PEER_SIBLING, AccessLogEntry::reply, ACLFilledChecklist::reply, PeerSelector::request, request(), ACLFilledChecklist::syncAle(), CachePeer::type, and _request::url.
Referenced by peerHTTPOkay(), peerWouldBePinged(), and PeerSelector::selectPinned().
◆ peerCanOpenMore()
bool peerCanOpenMore | ( | const CachePeer * | p | ) |
Definition at line 223 of file neighbors.cc.
References CachePeer::conn_open, debugs, CachePeer::max_conn, Squid_MaxFD, and CachePeer::stats.
Referenced by PeerPoolMgr::openNewConnection(), peerConnClosed(), and peerHTTPOkay().
◆ peerClearRR()
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 447 of file neighbors.cc.
References Config, CachePeer::next, NULL, SquidConfig::peers, and CachePeer::rr_count.
Referenced by peerAlive(), and peerClearRRLoop().
◆ peerClearRRLoop()
|
static |
This gets called every 5 minutes to clear the round-robin counter. The exact timing is an arbitrary default, set on estimate timing of a large number of requests in a high-performance environment during the period. The larger the number of requests between cycled resets the more balanced the operations.
- Parameters
-
data unused
TODO: Make the reset timing a selectable parameter in squid.conf
Definition at line 418 of file neighbors.cc.
References data, eventAdd(), and peerClearRR().
Referenced by peerClearRRStart().
◆ peerClearRRStart()
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 430 of file neighbors.cc.
References NULL, and peerClearRRLoop().
Referenced by parse_peer().
◆ peerConnClosed()
void peerConnClosed | ( | CachePeer * | p | ) |
Definition at line 247 of file neighbors.cc.
References PeerPoolMgr::Checkpoint(), CachePeer::conn_open, CachePeer::mgr, peerCanOpenMore(), CachePeer::standby, CachePeer::stats, and CachePeer::waitingForClose.
Referenced by Comm::Connection::noteClosure().
◆ peerConnectFailed()
void peerConnectFailed | ( | CachePeer * | p | ) |
Definition at line 1290 of file neighbors.cc.
References DBG_IMPORTANT, debugs, CachePeer::host, CachePeer::http_port, and peerConnectFailedSilent().
Referenced by Security::PeerConnector::bail(), Http::Tunneler::bailWith(), HappyConnOpener::connectDone(), PeerPoolMgr::handleOpenedConnection(), and Security::BlindPeerConnector::noteNegotiationDone().
◆ peerConnectFailedSilent()
|
static |
Definition at line 1271 of file neighbors.cc.
References DBG_IMPORTANT, debugs, CachePeer::host, CachePeer::http_port, CachePeer::last_connect_failure, CachePeer::logged_state, CachePeer::name, neighborTypeStr(), PEER_DEAD, squid_curtime, CachePeer::stats, and CachePeer::tcp_up.
Referenced by peerConnectFailed(), and peerProbeConnectDone().
◆ peerConnectSucceded()
void peerConnectSucceded | ( | CachePeer * | p | ) |
Definition at line 1297 of file neighbors.cc.
References CachePeer::connect_fail_limit, debugs, CachePeer::host, CachePeer::http_port, ipcache_nbgethostbyname(), CachePeer::n_addresses, peerAlive(), peerDNSConfigure, and CachePeer::tcp_up.
Referenced by peerProbeConnectDone(), and FwdState::successfullyConnectedToPeer().
◆ peerCountHandleIcpReply()
|
static |
Definition at line 1480 of file neighbors.cc.
References assert, current_time, data, Math::intAverage(), StoreEntry::mem_obj, CachePeer::options, AnyP::PROTO_ICP, CachePeer::rtt, RTT_AV_FACTOR, RTT_BACKGROUND_AV_FACTOR, MemObject::start_ping, CachePeer::stats, tvSubMsec(), and CachePeer::weighted_roundrobin.
◆ peerCountMcastPeersAbort()
|
static |
ends counting of multicast ICP replies to the ICP query initiated by peerCountMcastPeersCreateAndSend()
Definition at line 1458 of file neighbors.cc.
References StoreEntry::abort(), CachePeer::avg_n_members, cbdataReferenceDone, cbdataReferenceValid(), DBG_IMPORTANT, debugs, Math::doubleAverage(), PeerSelector::entry, CachePeer::flags, CachePeer::host, int, CachePeer::mcast, StoreEntry::mem_obj, ping_data::n_recv, CachePeer::n_replies_expected, CachePeer::n_times_counted, PeerSelector::peerCountMcastPeerXXX, PeerSelector::ping, MemObject::request, CachePeer::rtt, CachePeer::stats, and StoreEntry::unlock().
◆ peerCountMcastPeersCreateAndSend()
|
static |
Definition at line 1400 of file neighbors.cc.
References assert, cbdataReference, Config, current_time, eventAdd(), CachePeer::flags, HttpRequest::FromUrlXXX(), HTTPMSGLOCK(), ICP_QUERY, icpCreateAndSend(), icpOutgoingConn, icpSetCacheKey(), CachePeer::id, MemObject::id, CachePeer::in_addr, XactionInitiator::initPeerMcast, MemObject::ircb_data, hash_link::key, LOCAL_ARRAY, MAX_URL, CachePeer::mcast, SquidConfig::mcast_icp_query, mcastSetTtl(), StoreEntry::mem_obj, Http::METHOD_GET, PEER_MULTICAST, peerCountHandleIcpReply, peerCountMcastPeersDone(), MemObject::ping_reply_callback, StoreEntry::ping_status, PING_WAITING, MemObject::request, CodeContext::Reset(), MemObject::start_ping, storeCreateEntry(), SquidConfig::Timeout, Ip::Address::toUrl(), CachePeer::ttl, and CachePeer::type.
Referenced by peerCountMcastPeersStart().
◆ peerCountMcastPeersDone()
|
static |
Definition at line 1446 of file neighbors.cc.
References CallBack(), and data.
Referenced by peerCountMcastPeersCreateAndSend().
◆ peerCountMcastPeersSchedule()
|
static |
Definition at line 1375 of file neighbors.cc.
References eventAdd(), CachePeer::flags, CachePeer::mcast, and peerCountMcastPeersStart().
Referenced by peerCountMcastPeersStart(), and peerDNSConfigure().
◆ peerCountMcastPeersStart()
|
static |
Definition at line 1389 of file neighbors.cc.
References CallContextCreator(), data, MCAST_COUNT_RATE, peerCountMcastPeersCreateAndSend(), and peerCountMcastPeersSchedule().
Referenced by peerCountMcastPeersSchedule().
◆ peerDigestLookup()
lookup_t peerDigestLookup | ( | CachePeer * | p, |
PeerSelector * | ps | ||
) |
Definition at line 759 of file neighbors.cc.
References assert, PeerDigest::cd, CacheDigest::contains(), debugs, CachePeer::digest, PeerDigest::flags, CachePeer::host, LOOKUP_HIT, LOOKUP_MISS, LOOKUP_NONE, PeerDigest::needed, NULL, peerDigestNeeded(), peerHTTPOkay(), PeerSelector::request, request(), PeerDigest::requested, storeKeyPublicByRequest(), and PeerDigest::usable.
Referenced by PeerSelector::handleIcpReply(), and neighborsDigestSelect().
◆ peerDNSConfigure()
|
static |
Definition at line 1193 of file neighbors.cc.
References CachePeer::addresses, PeerPoolMgr::Checkpoint(), data, DBG_CRITICAL, DBG_IMPORTANT, debugs, Dns::CachedIps::empty(), eventAddIsh(), Dns::CachedIps::goodAndBad(), CachePeer::host, CachePeer::http_port, IamWorkerProcess(), CachePeer::icp, CachePeer::in_addr, CachePeer::mcast, CachePeer::mgr, CachePeer::n_addresses, neighborTypeStr(), netdbExchangeStart(), CachePeer::no_netdb_exchange, NULL, CachePeer::options, PEER_MAX_ADDRESSES, PEER_MULTICAST, peerCountMcastPeersSchedule(), peerProbeConnect(), CachePeer::icp_::port, Ip::Address::port(), Ip::Address::setEmpty(), Dns::CachedIps::size(), CachePeer::standby, CachePeer::ttl, CachePeer::type, and CbcPointer< Cbc >::valid().
◆ peerFindByName()
CachePeer* peerFindByName | ( | const char * | name | ) |
Definition at line 1124 of file neighbors.cc.
References Config, CachePeer::name, CachePeer::next, NULL, and SquidConfig::peers.
Referenced by netdbClosestParent(), parse_hostdomaintype(), parse_peer(), and parse_peer_access().
◆ peerFindByNameAndPort()
CachePeer* peerFindByNameAndPort | ( | const char * | name, |
unsigned short | port | ||
) |
Definition at line 1137 of file neighbors.cc.
References Config, CachePeer::http_port, CachePeer::name, CachePeer::next, NULL, SquidConfig::peers, and port.
◆ peerHasConnAvailable()
bool peerHasConnAvailable | ( | const CachePeer * | p | ) |
Definition at line 232 of file neighbors.cc.
References PconnPool::count(), debugs, CachePeer::pool, and CachePeer::standby.
Referenced by peerHTTPOkay().
◆ peerHTTPOkay()
int peerHTTPOkay | ( | const CachePeer * | p, |
PeerSelector * | ps | ||
) |
Definition at line 258 of file neighbors.cc.
References neighborUp(), peerAllowedToUse(), peerCanOpenMore(), and peerHasConnAvailable().
Referenced by carpSelectParent(), getDefaultParent(), getFirstUpParent(), getRoundRobinParent(), getWeightedRoundRobinParent(), ignoreMulticastReply(), netdbClosestParent(), peerDigestLookup(), peerSourceHashSelectParent(), peerUserHashSelectParent(), and PeerSelector::selectAllParents().
◆ peerNoteDigestLookup()
void peerNoteDigestLookup | ( | HttpRequest * | request, |
CachePeer * | p, | ||
lookup_t | lookup | ||
) |
Definition at line 868 of file neighbors.cc.
References debugs, CachePeer::host, lookup_t_str, and request().
Referenced by PeerSelector::handleIcpReply(), and neighborsDigestSelect().
◆ peerProbeConnect()
Definition at line 1327 of file neighbors.cc.
References CachePeer::addresses, commCbCall(), conn, CachePeer::connectTimeout(), getOutgoingAddress(), CachePeer::host, CachePeer::http_port, CachePeer::last_connect_probe, CachePeer::n_addresses, NULL, peerProbeConnectDone, peerProbeIsBusy(), CachePeer::reprobe, Comm::ConnOpener::setHost(), squid_curtime, AsyncJob::Start(), CachePeer::stats, and CachePeer::testing_now.
Referenced by neighborUp(), peerDNSConfigure(), and peerProbeConnectDone().
◆ peerProbeConnectDone()
|
static |
Definition at line 1356 of file neighbors.cc.
References conn, data, Comm::OK, peerConnectFailedSilent(), peerConnectSucceded(), peerProbeConnect(), CachePeer::reprobe, and CachePeer::testing_now.
◆ peerProbeIsBusy()
|
static |
Definition at line 1311 of file neighbors.cc.
References debugs, CachePeer::last_connect_probe, squid_curtime, CachePeer::stats, and CachePeer::testing_now.
Referenced by peerProbeConnect().
◆ peerRefreshDNS()
|
static |
Definition at line 1250 of file neighbors.cc.
References Config, data, eventAddIsh(), eventDelete(), eventFind(), CachePeer::host, ipcache_nbgethostbyname(), CachePeer::next, NULL, peerDNSConfigure, SquidConfig::peers, and stat5minClientRequests().
Referenced by neighbors_init().
◆ peerWouldBePinged()
|
static |
Definition at line 183 of file neighbors.cc.
References assert, CachePeer::background_ping, SquidConfig::backgroundPingRate, Config, SquidConfig::deadPeer, CachePeer::icp, CachePeer::last_query, CachePeer::mcast_responder, CachePeer::n_addresses, neighborUp(), CachePeer::no_query, CachePeer::options, PEER_SIBLING, peerAllowedToUse(), CachePeer::icp_::port, PeerSelector::request, request(), squid_curtime, CachePeer::stats, SquidConfig::Timeout, and CachePeer::type.
Referenced by neighborsCount(), and neighborsUdpPing().
◆ positiveTimeout()
time_t positiveTimeout | ( | const time_t | timeout | ) |
- Returns
- max(1, timeout)
Definition at line 1187 of file neighbors.cc.
References max().
Referenced by FwdState::connectingTimeout(), and PeerPoolMgr::handleOpenedConnection().
◆ whichPeer()
CachePeer* whichPeer | ( | const Ip::Address & | from | ) |
Definition at line 96 of file neighbors.cc.
References CachePeer::addresses, Config, debugs, CachePeer::icp, CachePeer::n_addresses, CachePeer::next, NULL, SquidConfig::peers, CachePeer::icp_::port, and Ip::Address::port().
Referenced by PeerSelector::checkNetdbDirect(), neighborsHtcpReply(), neighborsUdpAck(), and PeerSelector::selectSomeNeighborReplies().
Variable Documentation
◆ echo_port
|
static |
Definition at line 75 of file neighbors.cc.
Referenced by neighbors_init(), and neighborsUdpPing().
◆ first_ping
Definition at line 78 of file neighbors.cc.
Referenced by neighborRemove(), neighbors_init(), neighborsDigestSelect(), and neighborsUdpPing().
◆ neighborDumpNonPeers
|
static |
Definition at line 72 of file neighbors.cc.
Referenced by neighborsRegisterWithCacheManager().
◆ neighborDumpPeers
|
static |
Definition at line 71 of file neighbors.cc.
Referenced by neighborsRegisterWithCacheManager().
◆ NLateReplies
|
static |
Definition at line 77 of file neighbors.cc.
Referenced by neighborCountIgnored().
◆ non_peers
Definition at line 940 of file neighbors.cc.
Referenced by neighborDumpNonPeers(), and neighborIgnoreNonPeer().
◆ peerCountHandleIcpReply
|
static |
Definition at line 68 of file neighbors.cc.
Referenced by peerCountMcastPeersCreateAndSend().
◆ peerDNSConfigure
|
static |
Definition at line 60 of file neighbors.cc.
Referenced by peerConnectSucceded(), and peerRefreshDNS().
◆ peerProbeConnectDone
|
static |
Definition at line 62 of file neighbors.cc.
Referenced by peerProbeConnect().