39 const auto mx = MasterXaction::MakePortless<XactionInitiator::initPeerPool>();
86 debugs(48, 3,
"peer gone");
87 if (params.
conn !=
nullptr)
132 debugs(48, 3,
"peer gone");
133 if (answer.
conn !=
nullptr)
180 debugs(48, 7,
"overwhelmed");
217 debugs(48, 3, reason <<
" and peer gone");
223 debugs(48, 7, reason <<
" with " << count <<
" ? " << limit);
227 else if (count > limit)
235 debugs(48, 5, reason <<
" but no mgr");
240 CallJobHere1(48, 5, mgr, PeerPoolMgr, checkpoint, reason);
259 const auto p = peer.get();
264 if (p->standby.limit) {
266 p->standby.pool =
new PconnPool(p->name, p->standby.mgr);
268 AsyncJob::Start(p->standby.mgr.get());
#define asyncCallback(dbgSection, dbgLevel, method, object)
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method)
Convenience macro to create a Dialer-based job callback.
void NoteOutgoingConnectionFailure(CachePeer *const peer)
const CachePeers & CurrentCachePeers()
void CallService(const CodeContext::Pointer &serviceContext, Fun &&service)
void getOutgoingAddress(HttpRequest *request, const Comm::ConnectionPointer &conn)
void GetMarkingsToServer(HttpRequest *request, Comm::Connection &conn)
#define DefineRunnerRegistrator(ClassName)
int cbdataReferenceValid(const void *p)
#define cbdataReferenceDone(var)
#define cbdataReference(var)
#define CBDATA_CLASS_INIT(type)
void host(const char *src)
virtual bool doneAll() const
whether positive goal has been reached
virtual void start()
called by AsyncStart; do not call directly
Security::PeerOptions secure
security settings for peer connection
int limit
the limit itself
struct CachePeer::@25 standby
optional "cache_peer standby=limit" feature
PconnPool * pool
idle connection pool for this peer
bool waitingForClose
a conn must close before we open a standby conn
time_t connectTimeout() const
Ip::Address addresses[10]
Cbc * valid() const
was set and is valid
Cbc * get() const
a temporary valid raw Cbc pointer or NULL
Comm::Flag flag
comm layer result status.
Comm::ConnectionPointer conn
void setPeer(CachePeer *p)
static std::ostream & Extra(std::ostream &)
AnyP::Uri url
the request URI
unsigned short port() const
void start(const JobPointer &aJob, const AsyncCall::Pointer &aCallback)
starts waiting for the given job to call the given callback
void closeN(int n)
closes any n connections, regardless of their destination
void push(const Comm::ConnectionPointer &serverConn, const char *domain)
Maintains an fixed-size "standby" PconnPool for a single CachePeer.
JobWait< Security::BlindPeerConnector > encryptionWait
waits for the established transport connection to be secured/encrypted
void checkpoint(const char *reason)
void handleSecuredPeer(Security::EncryptorAnswer &answer)
Security::PeerConnector callback.
unsigned int addrUsed
counter for cycling through peer addresses
void openNewConnection()
starts the process of opening a new standby connection (if possible)
void start() override
called by AsyncStart; do not call directly
PrecomputedCodeContextPointer codeContext
RefCount< HttpRequest > request
fake HTTP request for conn opening code
void handleOpenedConnection(const CommConnectCbParams ¶ms)
Comm::ConnOpener calls this when done opening a connection for us.
void closeOldConnections(const int howMany)
closes 'howMany' standby connections
static void Checkpoint(const Pointer &mgr, const char *reason)
bool doneAll() const override
whether positive goal has been reached
CachePeer * peer
the owner of the pool we manage
JobWait< Comm::ConnOpener > transportWait
waits for a transport connection to the peer to be established/opened
void pushNewConnection(const Comm::ConnectionPointer &conn)
the final step in connection opening (and, optionally, securing) sequence
bool validPeer() const
whether the peer is still out there and in a valid state we can safely use
PeerPoolMgr(CachePeer *aPeer)
launches PeerPoolMgrs for peers configured with standby.limit
void syncConfig() override
void useConfig() override
CodeContext with constant details known at construction time.
A PeerConnector for TLS cache_peers and origin servers. No SslBump capabilities.
CbcPointer< ErrorState > error
problem details (nil on success)
Comm::ConnectionPointer conn
peer connection (secured on success)
bool tunneled
whether we spliced the connections instead of negotiating encryption
bool encryptTransport
whether transport encryption (TLS/SSL) is to be used on connections to the peer
#define debugs(SECTION, LEVEL, CONTENT)
bool IsConnOpen(const Comm::ConnectionPointer &conn)
int neighborUp(const CachePeer *p)
time_t positiveTimeout(const time_t timeout)
bool peerCanOpenMore(const CachePeer *p)
Whether we can open new connections to the peer (e.g., despite max-conn)
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf