neighbors.cc
Go to the documentation of this file.
146 (request->flags.noCache || request->flags.refresh || request->flags.loopDetected || request->flags.needValidation))
147 debugs(15, 2, "multicast-siblings optimization match for " << *p << ", " << request->url.authority());
163 // Unless the destination port matches, in which case we MAY perform a 'DIRECT' to this CachePeer.
164 if (p->options.originserver && request->method == Http::METHOD_CONNECT && request->url.port() != p->http_port)
199 if (p->options.background_ping && (squid_curtime - p->stats.last_query < Config.backgroundPingRate))
727 debugs(15, 5, "peerDigestLookup: !ready && " << (p->digest->flags.requested ? "" : "!") << "requested");
800 debugs(15, 4, "neighborsDigestSelect: choices: " << choice_count << " (" << ichoice_count << ")");
894 debugs(15, DBG_IMPORTANT, "WARNING: Ignored " << ignoredReplies << " ICP replies from non-peers" <<
992 debugs(15, 3, opcode_d << " for " << storeKeyText(key) << " from " << RawPointer(p).orNil("source"));
1213 AsyncCall::Pointer call = commCbCall(15,3, "peerProbeConnectDone", CommConnectCbPtrFun(peerProbeConnectDone, p));
1331 p->mcast.avg_n_members = Math::doubleAverage(p->mcast.avg_n_members, (double) psstate->ping.n_recv, ++p->mcast.n_times_counted, 10);
1424 if (p->options.htcp_oldsquid || p->options.htcp_no_clr || p->options.htcp_no_purge_clr || p->options.htcp_only_clr) {
1554 storeAppendPrintf(sentry, "IGNORED : %8d %3d%%\n", e->stats.ignored_replies, Math::intPercent(e->stats.ignored_replies, e->stats.pings_acked));
1593 storeAppendPrintf(sentry, "keep-alive ratio: %d%%\n", Math::intPercent(e->stats.n_keepalives_recv, e->stats.n_keepalives_sent));
1673neighborsHtcpClear(StoreEntry * e, HttpRequest * req, const HttpRequestMethod &method, htcp_clr_reason reason)
void DeleteConfigured(CachePeer *const peer)
destroys the given peer after removing it from the set of configured peers
Definition: CachePeers.cc:51
std::vector< CachePeer *, PoolingAllocator< CachePeer * > > RawCachePeers
Temporary, local storage of raw pointers to zero or more Config.peers.
Definition: CachePeers.h:66
void CallService(const CodeContext::Pointer &serviceContext, Fun &&service)
Definition: CodeContext.h:133
void CallBack(const CodeContext::Pointer &callbackContext, Fun &&callback)
Definition: CodeContext.h:116
CommCbFunPtrCallT< Dialer > * commCbCall(int debugSection, int debugLevel, const char *callName, const Dialer &dialer)
Definition: CommCalls.h:312
void CNCB(const Comm::ConnectionPointer &conn, Comm::Flag status, int xerrno, void *data)
Definition: CommCalls.h:33
void getOutgoingAddress(HttpRequest *request, const Comm::ConnectionPointer &conn)
Definition: FwdState.cc:1476
RawPointerT< Pointer > RawPointer(const char *label, const Pointer &ptr)
convenience wrapper for creating RawPointerT<> objects
Definition: IoManip.h:43
int matchDomainName(const char *h, const char *d, MatchDomainNameFlags flags)
Definition: Uri.cc:820
Definition: FilledChecklist.h:32
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
Definition: FilledChecklist.h:101
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
Definition: FilledChecklist.cc:121
Definition: AccessLogEntry.h:41
Definition: CachePeer.h:31
void noteSuccess()
reacts to a successful establishment of a connection to this cache_peer
Definition: CachePeer.cc:61
struct CachePeer::@28 options
struct CachePeer::@29 mcast
struct CachePeer::icp_ icp
struct CachePeer::@26 stats
struct CachePeer::@29::@35 flags
struct CachePeer::@27 htcp
auto size() const
the number of currently stored (i.e. added and not removed) cache_peers
Definition: CachePeers.h:33
static void Reset()
forgets the current context, setting it to nil/unknown
Definition: CodeContext.cc:77
Definition: CommCalls.h:215
Definition: ConnOpener.h:25
Definition: ipcache.h:51
Definition: htcp.h:22
Definition: RequestMethod.h:27
Definition: HttpRequest.h:49
static HttpRequest * FromUrlXXX(const char *url, const MasterXaction::Pointer &, const HttpRequestMethod &method=Http::METHOD_GET)
Definition: HttpRequest.cc:528
Definition: Address.h:41
void setEmpty()
Fast reset of the stored content to what would be after default constructor.
Definition: Address.cc:184
Definition: MemObject.h:34
representation of a neighbor_type_domain configuration directive. A POD
Definition: NeighborTypeDomainList.h:16
Definition: PackableStream.h:76
void count(int uses)
struct PeerDigest::@84 flags
static void Checkpoint(const Pointer &mgr, const char *reason)
Definition: PeerPoolMgr.cc:229
Definition: PeerSelectState.h:60
void * peerCountMcastPeerXXX
a hack to help peerCountMcastPeersStart()
Definition: PeerSelectState.h:101
Definition: RequestFlags.h:23
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 SquidConfig::@94 Port
struct SquidConfig::@106 onoff
struct SquidConfig::@93 Timeout
Definition: Store.h:42
bool hasDisk(const sdirno dirn=-1, const sfileno filen=-1) const
Definition: store.cc:1915
StoreEntry * findCallbackXXX(const cache_key *)
Definition: Controller.cc:395
Definition: EnumIterator.h:222
Definition: ICP.h:35
void eventAddIsh(const char *name, EVH *func, void *arg, double delta_ish, int weight)
Definition: event.cc:114
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
Definition: event.cc:107
int Squid_MaxFD
void ipcache_nbgethostbyname(const char *name, IPH *handler, void *handlerData)
Definition: ipcache.cc:608
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
void htcpClear(StoreEntry *e, HttpRequest *req, const HttpRequestMethod &, CachePeer *p, htcp_clr_reason reason)
Definition: htcp.cc:1564
const char * icp_opcode_str[]
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
Definition: forward.h:25
void IPH(const ipcache_addrs *, const Dns::LookupDetails &details, void *)
Definition: ipcache.h:227
const char * lookup_t_str[]
double doubleAverage(const double, const double, int, const int)
Definition: SquidMath.cc:31
void RegisterAction(char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
Definition: Registration.cc:16
void peerNoteDigestLookup(HttpRequest *request, CachePeer *p, lookup_t lookup)
Definition: neighbors.cc:813
static int peerWouldBePinged(const CachePeer *, PeerSelector *)
Definition: neighbors.cc:182
static void neighborAliveHtcp(CachePeer *, const MemObject *, const HtcpReplyData *)
Definition: neighbors.cc:868
static void peerCountMcastPeersSchedule(CachePeer *p, time_t when)
Definition: neighbors.cc:1241
void neighborsHtcpClear(StoreEntry *e, HttpRequest *req, const HttpRequestMethod &method, htcp_clr_reason reason)
Definition: neighbors.cc:1673
CachePeer * findCachePeerByName(const char *const name)
cache_peer with a given name (or nil)
Definition: neighbors.cc:1050
static void peerCountMcastPeersCreateAndSend(CachePeer *p)
initiates an ICP transaction to a multicast peer
Definition: neighbors.cc:1266
void neighborsHtcpReply(const cache_key *key, HtcpReplyData *htcp, const Ip::Address &from)
Definition: neighbors.cc:1599
static void neighborUpdateRtt(CachePeer *p, MemObject *mem)
Definition: neighbors.cc:843
bool peerHasConnAvailable(const CachePeer *p)
Whether the peer has idle or standby connections that can be used now.
Definition: neighbors.cc:231
static void peerCountMcastPeersAbort(PeerSelector *)
Definition: neighbors.cc:1324
void dump_peer_options(StoreEntry *sentry, CachePeer *p)
Definition: neighbors.cc:1371
static bool peerProbeIsBusy(const CachePeer *p)
whether new TCP probes are currently banned
Definition: neighbors.cc:1178
bool peerAllowedToUse(const CachePeer *, PeerSelector *)
Definition: neighbors.cc:137
static void neighborsRegisterWithCacheManager()
Definition: neighbors.cc:502
bool peerCanOpenMore(const CachePeer *p)
Whether we can open new connections to the peer (e.g., despite max-conn)
Definition: neighbors.cc:222
peer_t neighborType(const CachePeer *p, const AnyP::Uri &url)
Definition: neighbors.cc:114
int neighborsUdpPing(HttpRequest *request, StoreEntry *entry, IRCB *callback, PeerSelector *ps, int *exprep, int *timeout)
Definition: neighbors.cc:550
CachePeer * neighborsDigestSelect(PeerSelector *ps)
Definition: neighbors.cc:751
static void neighborAlive(CachePeer *, const MemObject *, const icp_common_t *)
Definition: neighbors.cc:831
lookup_t peerDigestLookup(CachePeer *p, PeerSelector *ps)
Definition: neighbors.cc:705
void peerConnClosed(CachePeer *p)
Notifies peer of an associated connection closure.
Definition: neighbors.cc:246
static void neighborIgnoreNonPeer(const Ip::Address &, icp_opcode)
Definition: neighbors.cc:890
static int ignoreMulticastReply(CachePeer *p, PeerSelector *ps)
Definition: neighbors.cc:907
void neighborsUdpAck(const cache_key *key, icp_common_t *header, const Ip::Address &from)
Definition: neighbors.cc:929
static void peerProbeConnect(CachePeer *, const bool reprobeIfBusy=false)
Definition: neighbors.cc:1194
CachePeer * getWeightedRoundRobinParent(PeerSelector *ps)
Definition: neighbors.cc:355
static void peerCountMcastPeersStart(void *data)
Definition: neighbors.cc:1255
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:745
const cache_key * storeKeyPublicByRequest(HttpRequest *request, const KeyScope keyScope)
Definition: store_key_md5.cc:110
bool IamWorkerProcess()
whether the current process handles HTTP transactions and such
Definition: stub_tools.cc:47
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
Definition: gadgets.cc:17