#include "anyp/forward.h"
#include "enums.h"
#include "ICP.h"
#include "lookup_t.h"
#include "typedefs.h"


Go to the source code of this file.
Function Documentation
◆ dump_peer_options()
void dump_peer_options | ( | StoreEntry * | sentry, |
CachePeer * | p | ||
) |
Definition at line 1461 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().
◆ findCachePeerByName()
CachePeer * findCachePeerByName | ( | const char * | name | ) |
Definition at line 1129 of file neighbors.cc.
References Config, CachePeer::name, CachePeer::next, and SquidConfig::peers.
Referenced by ConfigParser::cachePeer(), and parse_peer().
◆ getDefaultParent()
CachePeer * getDefaultParent | ( | PeerSelector * | ps | ) |
Definition at line 476 of file neighbors.cc.
References assert, Config, debugs, CachePeer::default_parent, neighborType(), CachePeer::next, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, PeerSelector::request, and HttpRequest::url.
Referenced by PeerSelector::selectAllParents(), and PeerSelector::selectSomeParent().
◆ getFirstPeer()
CachePeer * getFirstPeer | ( | void | ) |
Definition at line 510 of file neighbors.cc.
References Config, and SquidConfig::peers.
Referenced by statPeerSelect().
◆ getFirstUpParent()
CachePeer * getFirstUpParent | ( | PeerSelector * | ps | ) |
Definition at line 289 of file neighbors.cc.
References assert, Config, debugs, neighborType(), neighborUp(), CachePeer::next, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, RawPointer(), PeerSelector::request, and HttpRequest::url.
Referenced by PeerSelector::selectSomeParent().
◆ getNextPeer()
Definition at line 504 of file neighbors.cc.
References CachePeer::next.
Referenced by statPeerSelect().
◆ getRoundRobinParent()
CachePeer * getRoundRobinParent | ( | PeerSelector * | ps | ) |
Definition at line 314 of file neighbors.cc.
References assert, Config, debugs, neighborType(), CachePeer::next, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, RawPointer(), PeerSelector::request, CachePeer::roundrobin, CachePeer::rr_count, HttpRequest::url, and CachePeer::weight.
Referenced by PeerSelector::selectSomeParent().
◆ getSingleParent()
CachePeer * getSingleParent | ( | PeerSelector * | ) |
◆ getWeightedRoundRobinParent()
CachePeer * getWeightedRoundRobinParent | ( | PeerSelector * | ps | ) |
Definition at line 356 of file neighbors.cc.
References assert, CachePeer::basetime, Config, debugs, neighborType(), CachePeer::next, CachePeer::options, PEER_PARENT, peerHTTPOkay(), SquidConfig::peers, RawPointer(), PeerSelector::request, CachePeer::rr_count, CachePeer::rtt, CachePeer::stats, HttpRequest::url, CachePeer::weight, and CachePeer::weighted_roundrobin.
Referenced by PeerSelector::selectSomeParent().
◆ neighborAdd()
◆ neighborAddAcl()
void neighborAddAcl | ( | const char * | , |
const char * | |||
) |
◆ neighbors_init()
void neighbors_init | ( | void | ) |
Definition at line 557 of file neighbors.cc.
References Config, DBG_IMPORTANT, debugs, echo_port, Debug::Extra(), first_ping, getMyHostname(), getservbyname(), CachePeer::host, CachePeer::http_port, HttpPortList, icpIncomingConn, Comm::IsConnOpen(), neighborRemove(), neighborsRegisterWithCacheManager(), CachePeer::next, peerRefreshDNS(), SquidConfig::peers, and servent::s_port.
Referenced by mainInitialize(), and mainReconfigureFinish().
◆ neighborsCount()
int neighborsCount | ( | PeerSelector * | ps | ) |
Definition at line 274 of file neighbors.cc.
References Config, debugs, CachePeer::next, SquidConfig::peers, and peerWouldBePinged().
Referenced by peerSelectIcpPing().
◆ neighborsDigestSelect()
CachePeer * neighborsDigestSelect | ( | PeerSelector * | ps | ) |
Definition at line 802 of file neighbors.cc.
References assert, Config, debugs, first_ping, HttpRequest::flags, HttpRequest::hier, RequestFlags::hierarchical, CachePeer::host, LOOKUP_HIT, LOOKUP_MISS, LOOKUP_NONE, HierarchyLogEntry::n_choices, HierarchyLogEntry::n_ichoices, netdbHostRtt(), CachePeer::next, SquidConfig::npeers, peerDigestLookup(), peerNoteDigestLookup(), SquidConfig::peers, PeerSelector::request, and storeKeyPublicByRequest().
Referenced by PeerSelector::selectSomeNeighbor().
◆ neighborsHtcpClear()
void neighborsHtcpClear | ( | StoreEntry * | e, |
HttpRequest * | req, | ||
const HttpRequestMethod & | method, | ||
htcp_clr_reason | reason | ||
) |
Definition at line 1757 of file neighbors.cc.
References Config, debugs, CachePeer::htcp, HTCP_CLR_PURGE, CachePeer::htcp_no_clr, CachePeer::htcp_no_purge_clr, htcpClear(), CachePeer::in_addr, CachePeer::next, CachePeer::options, SquidConfig::peers, and Ip::Address::toUrl().
Referenced by httpMaybeRemovePublic(), purgeEntriesByUrl(), and clientReplyContext::purgeEntry().
◆ 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 1008 of file neighbors.cc.
References CachePeer::icp_::counts, DBG_CRITICAL, DBG_IMPORTANT, debug_trap(), debugs, EBIT_TEST, ENTRY_DISPATCHED, StoreEntry::flags, 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(), icp_common_t::opcode, PEER_NONE, PEER_SIBLING, MemObject::ping_reply_callback, StoreEntry::ping_status, PING_WAITING, CachePeer::pings_acked, AnyP::PROTO_ICP, RawPointer(), 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, Config, current_time, DBG_CRITICAL, DBG_IMPORTANT, debugs, echo_port, Comm::Connection::fd, first_ping, StoreEntry::getMD5Text(), StoreEntry::hasDisk(), 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, neighborType(), neighborTypeStr(), neighborUp(), CachePeer::next, SquidConfig::npeers, 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, CachePeer::rtt, squid_curtime, MemObject::start_ping, CachePeer::stats, SquidConfig::Timeout, CachePeer::ttl, CachePeer::type, HttpRequest::url, StoreEntry::url(), and CachePeer::icp_::version.
Referenced by PeerSelector::selectSomeNeighbor().
◆ neighborType()
Definition at line 116 of file neighbors.cc.
References NeighborTypeDomainList::domain, AnyP::Uri::host(), matchDomainName(), CachePeer::mcast_siblings, NeighborTypeDomainList::next, CachePeer::options, PEER_MULTICAST, PEER_NONE, PEER_SIBLING, CachePeer::type, NeighborTypeDomainList::type, and CachePeer::typelist.
Referenced by findUsableParentAtHostname(), getDefaultParent(), getFirstUpParent(), getRoundRobinParent(), getWeightedRoundRobinParent(), neighborsHtcpReply(), neighborsUdpAck(), neighborsUdpPing(), peerAllowedToUse(), PeerSelector::selectAllParents(), PeerSelector::selectSomeNeighbor(), and HttpStateData::sendRequest().
◆ neighborTypeStr()
const char * neighborTypeStr | ( | const CachePeer * | e | ) |
Definition at line 82 of file neighbors.cc.
References PEER_MULTICAST, PEER_NONE, PEER_SIBLING, and CachePeer::type.
Referenced by CachePeer::countFailure(), dump_peer(), dump_peers(), neighborsUdpPing(), peerAlive(), and peerDNSConfigure().
◆ neighborUp()
Definition at line 1142 of file neighbors.cc.
References CallService(), Config, SquidConfig::deadPeer, debugs, 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().
◆ peerAlive()
void peerAlive | ( | CachePeer * | p | ) |
Updates protocol-agnostic CachePeer state after an indication of a successful contact with the given cache_peer.
Definition at line 457 of file neighbors.cc.
References PeerPoolMgr::Checkpoint(), DBG_IMPORTANT, debugs, CachePeer::host, ipcache_nbgethostbyname(), CachePeer::last_reply, CachePeer::logged_state, CachePeer::mgr, CachePeer::n_addresses, neighborTypeStr(), PEER_ALIVE, PEER_DEAD, peerClearRR(), peerDNSConfigure, CachePeer::probe_start, squid_curtime, CachePeer::standby, CachePeer::stats, CachePeer::tcp_up, and CbcPointer< Cbc >::valid().
Referenced by neighborAlive(), neighborAliveHtcp(), and CachePeer::noteSuccess().
◆ peerCanOpenMore()
bool peerCanOpenMore | ( | const CachePeer * | p | ) |
Definition at line 224 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 448 of file neighbors.cc.
References Config, CachePeer::next, SquidConfig::peers, and CachePeer::rr_count.
Referenced by peerAlive(), and peerClearRRLoop().
◆ 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 431 of file neighbors.cc.
References peerClearRRLoop().
Referenced by parse_peer().
◆ peerConnClosed()
void peerConnClosed | ( | CachePeer * | p | ) |
Definition at line 248 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().
◆ peerDigestLookup()
lookup_t peerDigestLookup | ( | CachePeer * | p, |
PeerSelector * | ps | ||
) |
Definition at line 756 of file neighbors.cc.
References assert, PeerDigest::cd, CacheDigest::contains(), debugs, CachePeer::digest, PeerDigest::flags, LOOKUP_HIT, LOOKUP_MISS, LOOKUP_NONE, PeerDigest::needed, peerDigestNeeded(), peerHTTPOkay(), PeerSelector::request, PeerDigest::requested, storeKeyPublicByRequest(), and PeerDigest::usable.
Referenced by PeerSelector::handleIcpReply(), and neighborsDigestSelect().
◆ peerHasConnAvailable()
bool peerHasConnAvailable | ( | const CachePeer * | p | ) |
Definition at line 233 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 259 of file neighbors.cc.
References neighborUp(), peerAllowedToUse(), peerCanOpenMore(), and peerHasConnAvailable().
Referenced by carpSelectParent(), findUsableParentAtHostname(), getDefaultParent(), getFirstUpParent(), getRoundRobinParent(), getWeightedRoundRobinParent(), ignoreMulticastReply(), peerDigestLookup(), peerSourceHashSelectParent(), peerUserHashSelectParent(), and PeerSelector::selectAllParents().
◆ peerNoteDigestGone()
void peerNoteDigestGone | ( | CachePeer * | p | ) |
◆ peerNoteDigestLookup()
void peerNoteDigestLookup | ( | HttpRequest * | request, |
CachePeer * | p, | ||
lookup_t | lookup | ||
) |
Definition at line 869 of file neighbors.cc.
References HierarchyLogEntry::cd_host, HierarchyLogEntry::cd_lookup, debugs, HttpRequest::hier, CachePeer::host, lookup_t_str, and RawPointer().
Referenced by PeerSelector::handleIcpReply(), and neighborsDigestSelect().
◆ positiveTimeout()
time_t positiveTimeout | ( | const time_t | timeout | ) |
- Returns
- max(1, timeout)
Definition at line 1177 of file neighbors.cc.
References max().
Referenced by FwdState::connectingTimeout(), and PeerPoolMgr::handleOpenedConnection().
◆ whichPeer()
CachePeer * whichPeer | ( | const Ip::Address & | from | ) |
Definition at line 97 of file neighbors.cc.
References CachePeer::addresses, Config, debugs, CachePeer::icp, CachePeer::n_addresses, CachePeer::next, SquidConfig::peers, CachePeer::icp_::port, and Ip::Address::port().
Referenced by PeerSelector::checkNetdbDirect(), neighborsHtcpReply(), neighborsUdpAck(), and PeerSelector::selectSomeNeighborReplies().