neighbors.cc
Go to the documentation of this file.
145 (request->flags.noCache || request->flags.refresh || request->flags.loopDetected || request->flags.needValidation))
146 debugs(15, 2, "multicast-siblings optimization match for " << *p << ", " << request->url.authority());
162 // Unless the destination port matches, in which case we MAY perform a 'DIRECT' to this CachePeer.
163 if (p->options.originserver && request->method == Http::METHOD_CONNECT && request->url.port() != p->http_port)
194 if (p->options.background_ping && (squid_curtime - p->stats.last_query < Config.backgroundPingRate))
725 debugs(15, 5, "peerDigestLookup: !ready && " << (p->digest->flags.requested ? "" : "!") << "requested");
798 debugs(15, 4, "neighborsDigestSelect: choices: " << choice_count << " (" << ichoice_count << ")");
892 debugs(15, DBG_IMPORTANT, "WARNING: Ignored " << ignoredReplies << " ICP replies from non-peers" <<
990 debugs(15, 3, opcode_d << " for " << storeKeyText(key) << " from " << RawPointer(p).orNil("source"));
1224 AsyncCall::Pointer call = commCbCall(15,3, "peerProbeConnectDone", CommConnectCbPtrFun(peerProbeConnectDone, p));
1342 p->mcast.avg_n_members = Math::doubleAverage(p->mcast.avg_n_members, (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10);
1556 storeAppendPrintf(sentry, "IGNORED : %8d %3d%%\n", e->stats.ignored_replies, Math::intPercent(e->stats.ignored_replies, e->stats.pings_acked));
1595 storeAppendPrintf(sentry, "keep-alive ratio: %d%%\n", Math::intPercent(e->stats.n_keepalives_recv, e->stats.n_keepalives_sent));
1675 neighborsHtcpClear(StoreEntry * e, HttpRequest * req, const HttpRequestMethod &method, htcp_clr_reason reason)
static void neighborAlive(CachePeer *, const MemObject *, const icp_common_t *)
Definition: neighbors.cc:829
Definition: FilledChecklist.h:33
Definition: ipcache.h:50
const cache_key * storeKeyPublicByRequest(HttpRequest *request, const KeyScope keyScope)
Definition: store_key_md5.cc:110
struct CachePeer::@26 htcp
struct SquidConfig::@85 Port
int neighborsUdpPing(HttpRequest *request, StoreEntry *entry, IRCB *callback, PeerSelector *ps, int *exprep, int *timeout)
Definition: neighbors.cc:544
void noteSuccess()
reacts to a successful establishment of a connection to this cache_peer
Definition: CachePeer.cc:71
static void peerProbeConnect(CachePeer *, const bool reprobeIfBusy=false)
Definition: neighbors.cc:1205
Definition: CachePeer.h:28
Definition: ConnOpener.h:24
struct CachePeer::@25 stats
struct SquidConfig::@97 onoff
Definition: PackableStream.h:75
void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from, AccessLogEntryPointer)
Definition: icp_v2.cc:418
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
void CallBack(const CodeContext::Pointer &callbackContext, Fun &&callback)
Definition: CodeContext.h:126
int matchDomainName(const char *h, const char *d, MatchDomainNameFlags flags)
Definition: Uri.cc:860
Definition: htcp.h:21
Definition: AccessLogEntry.h:40
void htcpClear(StoreEntry *e, HttpRequest *req, const HttpRequestMethod &, CachePeer *p, htcp_clr_reason reason)
Definition: htcp.cc:1564
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
Definition: FilledChecklist.cc:110
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
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
Definition: forward.h:25
static void Reset()
forgets the current context, setting it to nil/unknown
Definition: CodeContext.cc:77
CachePeer * getWeightedRoundRobinParent(PeerSelector *ps)
Definition: neighbors.cc:349
void CNCB(const Comm::ConnectionPointer &conn, Comm::Flag status, int xerrno, void *data)
Definition: CommCalls.h:33
void neighborsHtcpReply(const cache_key *key, HtcpReplyData *htcp, const Ip::Address &from)
Definition: neighbors.cc:1601
Definition: EnumIterator.h:221
Definition: HttpRequest.h:48
struct CachePeer::@28 mcast
static void peerCountMcastPeersCreateAndSend(CachePeer *p)
initiates an ICP transaction to a multicast peer
Definition: neighbors.cc:1277
CachePeer * findCachePeerByName(const char *const name)
cache_peer with a given name (or nil)
Definition: neighbors.cc:1048
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
Definition: gadgets.cc:18
void noteFailure()
reacts to a failed attempt to establish a connection to this cache_peer
Definition: CachePeer.cc:86
struct PeerDigest::@75 flags
PrecomputedCodeContextPointer probeCodeContext
Definition: CachePeer.h:228
void dump_peer_options(StoreEntry *sentry, CachePeer *p)
Definition: neighbors.cc:1382
Definition: RequestFlags.h:22
static void neighborIgnoreNonPeer(const Ip::Address &, icp_opcode)
Definition: neighbors.cc:888
void peerConnClosed(CachePeer *p)
Notifies peer of an associated connection closure.
Definition: neighbors.cc:241
void count(int uses)
bool peerAllowedToUse(const CachePeer *, PeerSelector *)
Definition: neighbors.cc:137
void neighborsUdpAck(const cache_key *key, icp_common_t *header, const Ip::Address &from)
Definition: neighbors.cc:927
bool hasDisk(const sdirno dirn=-1, const sfileno filen=-1) const
Definition: store.cc:1929
void ipcache_nbgethostbyname(const char *name, IPH *handler, void *handlerData)
Definition: ipcache.cc:609
Definition: RequestMethod.h:26
representation of a neighbor_type_domain configuration directive. A POD
Definition: NeighborTypeDomainList.h:15
std::vector< CachePeer *, PoolingAllocator< CachePeer * > > RawCachePeers
Temporary, local storage of raw pointers to zero or more Config.peers.
Definition: CachePeers.h:66
struct CachePeer::icp_ icp
CommCbFunPtrCallT< Dialer > * commCbCall(int debugSection, int debugLevel, const char *callName, const Dialer &dialer)
Definition: CommCalls.h:312
void neighborsHtcpClear(StoreEntry *e, HttpRequest *req, const HttpRequestMethod &method, htcp_clr_reason reason)
Definition: neighbors.cc:1675
virtual void dumpCfg(std::ostream &, const char *pfx) const
output squid.conf syntax with 'pfx' prefix on parameters for the stored settings
Definition: PeerOptions.cc:105
struct CachePeer::@28::@34 flags
CachePeer * neighborsDigestSelect(PeerSelector *ps)
Definition: neighbors.cc:749
bool peerCanOpenMore(const CachePeer *p)
Whether we can open new connections to the peer (e.g., despite max-conn)
Definition: neighbors.cc:217
auto & prefixedBy(const char *const p)
a c-string to print before the first item (if any). Caller must ensure lifetime.
Definition: IoManip.h:182
void setEmpty()
Fast reset of the stored content to what would be after default constructor.
Definition: Address.cc:204
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:759
int Squid_MaxFD
static bool peerProbeIsBusy(const CachePeer *p)
whether new TCP probes are currently banned
Definition: neighbors.cc:1189
const char * lookup_t_str[]
void peerNoteDigestLookup(HttpRequest *request, CachePeer *p, lookup_t lookup)
Definition: neighbors.cc:811
Definition: MemObject.h:33
static void neighborsRegisterWithCacheManager()
Definition: neighbors.cc:496
static int peerWouldBePinged(const CachePeer *, PeerSelector *)
Definition: neighbors.cc:177
double doubleAverage(const double, const double, int, const int)
Definition: SquidMath.cc:31
Definition: Store.h:37
static void peerScheduleDnsRefreshCheck(const double delayInSeconds)
Definition: neighbors.cc:1155
StoreEntry * findCallbackXXX(const cache_key *)
Definition: Controller.cc:389
struct SquidConfig::@84 Timeout
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
Definition: Registration.cc:54
auto size() const
the number of currently stored (i.e. added and not removed) cache_peers
Definition: CachePeers.h:33
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Definition: HttpRequest.cc:528
Definition: PeerSelectState.h:59
static void neighborAliveHtcp(CachePeer *, const MemObject *, const HtcpReplyData *)
Definition: neighbors.cc:866
struct CachePeer::@27 options
lookup_t peerDigestLookup(CachePeer *p, PeerSelector *ps)
Definition: neighbors.cc:703
static void peerCountMcastPeersAbort(PeerSelector *)
Definition: neighbors.cc:1335
static int ignoreMulticastReply(CachePeer *p, PeerSelector *ps)
Definition: neighbors.cc:905
void eventAddIsh(const char *name, EVH *func, void *arg, double delta_ish, int weight)
Definition: event.cc:114
void CallService(const CodeContext::Pointer &serviceContext, Fun &&service)
Definition: CodeContext.h:151
Definition: ICP.h:35
static void Checkpoint(const Pointer &mgr, const char *reason)
Definition: PeerPoolMgr.cc:232
RawPointerT< Pointer > RawPointer(const char *label, const Pointer &ptr)
convenience wrapper for creating RawPointerT<> objects
Definition: IoManip.h:73
static void peerCountMcastPeersStart(void *data)
Definition: neighbors.cc:1266
void DeleteConfigured(CachePeer *const peer)
destroys the given peer after removing it from the set of configured peers
Definition: CachePeers.cc:53
bool peerHasConnAvailable(const CachePeer *p)
Whether the peer has idle or standby connections that can be used now.
Definition: neighbors.cc:226
static void peerCountMcastPeersSchedule(CachePeer *p, time_t when)
Definition: neighbors.cc:1252
Definition: Address.h:42
void * peerCountMcastPeerXXX
a hack to help peerCountMcastPeersStart()
Definition: PeerSelectState.h:101
static void neighborUpdateRtt(CachePeer *p, MemObject *mem)
Definition: neighbors.cc:841
void updateAle(const AccessLogEntry::Pointer &)
Definition: FilledChecklist.cc:242
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
const char * icp_opcode_str[]
void IPH(const ipcache_addrs *, const Dns::LookupDetails &details, void *)
Definition: ipcache.h:227
Definition: CommCalls.h:213
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