peer_select.cc
Go to the documentation of this file.
81 PeerSelectionDumper(const PeerSelector * const aSelector, const CachePeer * const aPeer, const hier_code aCode):
154 eventAdd("PeerSelectorPingMonitor::NoteWaitOver", &PeerSelectorPingMonitor::NoteWaitOver, this, interval, 0, false);
330 PeerSelectionInitiator::startSelectingDestinations(HttpRequest *request, const AccessLogEntry::Pointer &ale, StoreEntry *entry)
352 debugs(44, DBG_IMPORTANT, "WARNING: never_direct resulted in " << answer << ". Username ACLs are not reliable here.");
379 debugs(44, DBG_IMPORTANT, "WARNING: always_direct resulted in " << answer << ". Username ACLs are not reliable here.");
459 // Bug 3605: clear any extra listed FwdServer destinations, when the options exceeds max_foward_tries.
461 // TODO: use a std::list so we can get the size and abort adding whenever the selection loops reach Config.forward_max_tries
1060 PeerSelector::HandlePingReply(CachePeer * p, peer_t type, AnyP::ProtocolType proto, void *pingdata, void *data)
1063 static_cast<PeerSelector*>(data)->handleIcpReply(p, type, static_cast<icp_common_t*>(pingdata));
1068 static_cast<PeerSelector*>(data)->handleHtcpReply(p, type, static_cast<HtcpReplyData*>(pingdata));
void selectSomeDirect()
Adds a "direct" entry if the request can be forwarded to the origin server.
Definition: peer_select.cc:811
static CodeContext::Pointer & Instance()
guarantees the forever existence of the pointer, starting from the first use
Definition: CodeContext.cc:26
Definition: peer_select.cc:50
Definition: ipcache.h:50
void resolveSelected()
A single DNS resolution loop iteration: Converts selected FwdServer to IPs.
Definition: peer_select.cc:406
static void NoteWaitOver(void *monitor)
PeerSelectorPingMonitor::noteWaitOver() wrapper.
Definition: peer_select.cc:142
Interface for those who need a list of peers to forward a request to.
Definition: PeerSelectState.h:32
Definition: peer_select.cc:108
Definition: Acl.h:53
struct SquidConfig::@98 accessList
int neighborsUdpPing(HttpRequest *request, StoreEntry *entry, IRCB *callback, PeerSelector *ps, int *exprep, int *timeout)
Definition: neighbors.cc:544
WaitingPeerSelectorPosition monitorRegistration
maintained by PeerSelectorPingMonitor
Definition: PingData.h:49
void handlePath(const Comm::ConnectionPointer &path, FwdServer &fs)
processes a newly discovered/finalized path
Definition: peer_select.cc:1158
void netdbUpdatePeer(const AnyP::Uri &url, CachePeer *e, int irtt, int ihops)
Definition: net_db.cc:986
void noteLookup(const Dns::LookupDetails &details) override
Definition: peer_select.cc:495
void handleHtcpParentMiss(CachePeer *, HtcpReplyData *)
Definition: peer_select.cc:1017
void noteIps(const Dns::CachedIps *ips, const Dns::LookupDetails &details) override
Definition: peer_select.cc:535
void checkAlwaysDirectDone(const Acl::Answer answer)
Definition: peer_select.cc:365
CachePeer * peerUserHashSelectParent(PeerSelector *ps)
Definition: peer_userhash.cc:155
void startSelectingDestinations(HttpRequest *request, const AccessLogEntry::Pointer &ale, StoreEntry *entry)
Definition: peer_select.cc:330
Definition: CachePeer.h:28
static void peerSelect(PeerSelectionInitiator *initiator, HttpRequest *request, AccessLogEntry::Pointer const &al, StoreEntry *entry)
Definition: peer_select.cc:299
void monitor(PeerSelector *)
registers the given selector to be notified about the IPC ping timeout
Definition: peer_select.cc:192
struct SquidConfig::@97 onoff
void handleHtcpReply(CachePeer *, const peer_t, HtcpReplyData *)
Definition: peer_select.cc:995
static PeerSelectorPingMonitor & PingMonitor()
monitors all PeerSelector ICP ping timeouts
Definition: peer_select.cc:132
void CallBack(const CodeContext::Pointer &callbackContext, Fun &&callback)
Definition: CodeContext.h:126
Definition: htcp.h:21
a helper class to report a selected destination (for debugging)
Definition: peer_select.cc:78
static std::ostream & operator<<(std::ostream &os, const PeerSelectionDumper &fsd)
prints PeerSelectionDumper (for debugging)
Definition: peer_select.cc:93
void getOutgoingAddress(HttpRequest *request, const Comm::ConnectionPointer &conn)
Definition: FwdState.cc:1481
peer_t neighborType(const CachePeer *p, const AnyP::Uri &url)
Definition: neighbors.cc:116
CachePeer * getWeightedRoundRobinParent(PeerSelector *ps)
Definition: neighbors.cc:349
Definition: HttpRequest.h:48
static ACLCB CheckNeverDirectDone
Definition: PeerSelectState.h:133
void startWaiting()
schedules a single event to represent all waiting selectors
Definition: peer_select.cc:150
static MakingPointer Make(const acl_access *a, HttpRequest *r)
Definition: FilledChecklist.h:49
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
Definition: gadgets.cc:18
WaitingPeerSelectors::iterator WaitingPeerSelectorPosition
Definition: PingData.h:22
static int peerSelectIcpPing(PeerSelector *ps, int direct, StoreEntry *entry)
Definition: peer_select.cc:273
void nbgethostbyname(const char *name, const CbcPointer< IpReceiver > &receiver)
initiate an (often) asynchronous DNS lookup; the receiver gets the results
Definition: ipcache.cc:616
void handleIcpParentMiss(CachePeer *, icp_common_t *)
Definition: peer_select.cc:919
PeerSelectionInitiator * interestedInitiator()
Definition: peer_select.cc:1133
struct timeval peer_select_start
Definition: HierarchyLogEntry.h:54
void recordLookup(const Dns::LookupDetails &detail)
Definition: HttpRequest.cc:580
std::multimap< timeval, PeerSelector *, std::less< timeval >, PoolingAllocator< WaitingPeerSelector > > WaitingPeerSelectors
waiting PeerSelector objects, ordered by their absolute deadlines
Definition: PingData.h:21
void checkNeverDirectDone(const Acl::Answer answer)
Definition: peer_select.cc:338
bool subscribed
whether noteDestination() and noteDestinationsEnd() calls are allowed
Definition: PeerSelectState.h:46
void addSelection(CachePeer *, const hier_code)
Definition: peer_select.cc:1077
static void NonBlockingCheck(MakingPointer &&p, ACLCB *cb, void *data)
Definition: FilledChecklist.h:54
int neighbors_do_private_keys
bool peerAllowedToUse(const CachePeer *, PeerSelector *)
Definition: neighbors.cc:137
struct HtcpReplyData::cto_t cto
PeerSelectionDumper(const PeerSelector *const aSelector, const CachePeer *const aPeer, const hier_code aCode)
Definition: peer_select.cc:81
void cancelPingTimeoutMonitoring()
terminates ICP ping timeout monitoring
Definition: peer_select.cc:267
CachePeer * neighborsDigestSelect(PeerSelector *ps)
Definition: neighbors.cc:749
static void HandlePingTimeout(PeerSelector *)
called when the given selector should stop expecting ICP ping responses
Definition: peer_select.cc:907
Definition: forward.h:15
void startPingWaiting()
switches into the PING_WAITING state (and associated timeout monitoring)
Definition: peer_select.cc:258
void peerNoteDigestLookup(HttpRequest *request, CachePeer *p, lookup_t lookup)
Definition: neighbors.cc:811
CachePeer * peerSourceHashSelectParent(PeerSelector *ps)
Definition: peer_sourcehash.cc:150
time_t struct timeval struct timeval struct timeval struct timeval const struct timeval const &STUB void tvAdd(struct timeval &, struct timeval const &, struct timeval const &) STUB void tvAssignAdd(struct timeval &
struct ConnStateData::@36 pinning
const char * hier_code_str[]
Initiator initiator_
recipient of the destinations we select; use interestedInitiator() to access
Definition: PeerSelectState.h:163
Definition: Store.h:37
static ACLCB CheckAlwaysDirectDone
Definition: PeerSelectState.h:132
void forget(PeerSelector *)
removes a PeerSelector from the waiting list
Definition: peer_select.cc:208
void noteIp(const Ip::Address &ip) override
Called when/if nbgethostbyname() discovers a new good IP address.
Definition: peer_select.cc:509
bool wantsMoreDestinations() const
Definition: peer_select.cc:1152
InstanceIdDefinitions(PeerSelector, "PeerSelector")
void handleIcpReply(CachePeer *, const peer_t, icp_common_t *header)
Definition: peer_select.cc:962
void selectAllParents()
Adds alive parents. Used as a last resort for never_direct.
Definition: peer_select.cc:858
void selectSomeNeighborReplies()
Selects a neighbor (parent or sibling) based on ICP/HTCP replies.
Definition: peer_select.cc:780
Definition: PeerSelectState.h:59
struct CachePeer::@27 options
static struct @73 PeerStats
lookup_t peerDigestLookup(CachePeer *p, PeerSelector *ps)
Definition: neighbors.cc:703
void noteWaitOver()
calls back all ready PeerSelectors and continues to wait for others
Definition: peer_select.cc:168
Definition: errorpage.h:88
void selectPinned()
Selects a pinned connection if it exists, is valid, and is allowed.
Definition: peer_select.cc:698
Definition: ICP.h:35
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
Definition: HttpRequest.cc:744
void selectMore()
a single selection loop iteration: attempts to add more destinations
Definition: peer_select.cc:604
Definition: Address.h:42
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
const char * icp_opcode_str[]
CbcPointer< ConnStateData > clientConnectionManager
Definition: HttpRequest.h:232
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products