|
Squid Web Cache master
|
#include <ResolvedPeers.h>
Public Types | |
| typedef std::vector< ResolvedPeerPath > | Paths |
| using | size_type = Paths::size_type |
| typedef RefCount< ResolvedPeers > | Pointer |
Public Member Functions | |
| void * | operator new (size_t byteCount) |
| void | operator delete (void *address) |
| ResolvedPeers () | |
| bool | empty () const |
| whether we lack any known candidate paths | |
| void | addPath (const Comm::ConnectionPointer &) |
| add a candidate path to try after all the existing paths | |
| void | reinstatePath (const PeerConnectionPointer &) |
| PeerConnectionPointer | extractFront () |
| extracts and returns the first queued address | |
| PeerConnectionPointer | extractPrime (const Comm::Connection ¤tPeer) |
| PeerConnectionPointer | extractSpare (const Comm::Connection ¤tPeer) |
| bool | haveSpare (const Comm::Connection ¤tPeer) |
| whether extractSpare() would return a non-nil path right now | |
| bool | doneWithPrimes (const Comm::Connection ¤tPeer) |
| whether extractPrime() returns and will continue to return nil | |
| bool | doneWithSpares (const Comm::Connection ¤tPeer) |
| whether extractSpare() returns and will continue to return nil | |
| bool | doneWithPeer (const Comm::Connection ¤tPeer) |
| whether doneWithPrimes() and doneWithSpares() are true for currentPeer | |
| size_type | size () const |
| the current number of candidate paths | |
Static Public Member Functions | |
| static int | UseCount () |
Public Attributes | |
| bool | destinationsFinalized = false |
| whether all of the available candidate paths received from DNS | |
| bool | notificationPending = false |
| whether HappyConnOpener::noteCandidatesChange() is scheduled to fire | |
Private Types | |
| typedef std::pair< Paths::iterator, bool > | Finding |
Private Member Functions | |
| Paths::iterator | start () |
| Finding | findSpare (const Comm::Connection ¤tPeer) |
| Finding | findPrime (const Comm::Connection ¤tPeer) |
| Finding | findPeer (const Comm::Connection ¤tPeer) |
| PeerConnectionPointer | extractFound (const char *description, const Paths::iterator &found) |
| convenience method to finish a successful extract*() call | |
| Finding | makeFinding (const Paths::iterator &found, bool foundOther) |
| finalizes the iterator part of the given preliminary find*() result | |
| bool | doneWith (const Finding &findings) const |
| void | increaseAvailability () |
| increments the number of available paths | |
| void | decreaseAvailability () |
| decrements the number of available paths | |
Static Private Member Functions | |
| static Mem::AllocatorProxy & | Pool () |
| static int | ConnectionFamily (const Comm::Connection &conn) |
| The protocol family of the given path, AF_INET or AF_INET6. | |
Private Attributes | |
| Paths | paths_ |
| resolved addresses in (peer, family) order | |
| size_type | pathsToSkip = 0 |
| size_type | availablePaths = 0 |
| the total number of currently available elements in paths_ | |
cache_peer and origin server addresses (a.k.a. paths) selected and resolved by the peering code
Definition at line 33 of file ResolvedPeers.h.
|
private |
A find*() result: An iterator of the found path (or paths_.end()) and whether the "other" path was found instead.
Definition at line 90 of file ResolvedPeers.h.
| typedef std::vector<ResolvedPeerPath> ResolvedPeers::Paths |
Definition at line 39 of file ResolvedPeers.h.
| typedef RefCount<ResolvedPeers> ResolvedPeers::Pointer |
Definition at line 41 of file ResolvedPeers.h.
| using ResolvedPeers::size_type = Paths::size_type |
Definition at line 40 of file ResolvedPeers.h.
| ResolvedPeers::ResolvedPeers | ( | ) |
Definition at line 18 of file ResolvedPeers.cc.
References Config, SquidConfig::forward_max_tries, and paths_.
| void ResolvedPeers::addPath | ( | const Comm::ConnectionPointer & | path | ) |
Definition at line 48 of file ResolvedPeers.cc.
References increaseAvailability(), Must, and paths_.
Referenced by FwdState::noteDestination(), and TunnelStateData::noteDestination().
|
staticprivate |
Definition at line 199 of file ResolvedPeers.cc.
References Ip::Address::isIPv4(), and Comm::Connection::remote.
Referenced by findPrime(), and findSpare().
|
private |
Definition at line 214 of file ResolvedPeers.cc.
References assert, and availablePaths.
Referenced by extractFound().
|
private |
whether paths_ have no (and will have no) Xs for the current peer based on the given findX(current peer) result
Definition at line 169 of file ResolvedPeers.cc.
References destinationsFinalized, and paths_.
Referenced by doneWithPeer(), doneWithPrimes(), and doneWithSpares().
| bool ResolvedPeers::doneWithPeer | ( | const Comm::Connection & | currentPeer | ) |
Definition at line 193 of file ResolvedPeers.cc.
References doneWith(), and findPeer().
Referenced by HappyConnOpener::checkForNewConnection().
| bool ResolvedPeers::doneWithPrimes | ( | const Comm::Connection & | currentPeer | ) |
Definition at line 187 of file ResolvedPeers.cc.
References doneWith(), and findPrime().
Referenced by HappyConnOpener::updateSpareWaitAfterPrimeFailure().
| bool ResolvedPeers::doneWithSpares | ( | const Comm::Connection & | currentPeer | ) |
Definition at line 181 of file ResolvedPeers.cc.
References doneWith(), and findSpare().
Referenced by HappyConnOpener::checkForNewConnection(), and HappyConnOpener::maybeGivePrimeItsChance().
|
inline |
Definition at line 46 of file ResolvedPeers.h.
References availablePaths.
Referenced by FwdState::connectStart(), HappyConnOpener::doneAll(), extractFront(), HappyConnOpener::maybeOpenPrimeConnection(), HappyConnOpener::maybeOpenSpareConnection(), FwdState::noteDestination(), TunnelStateData::noteDestination(), operator<<(), FwdState::reforward(), TunnelStateData::retryOrBail(), TunnelStateData::startConnecting(), and FwdState::useDestinations().
|
private |
Definition at line 143 of file ResolvedPeers.cc.
References assert, debugs, decreaseAvailability(), paths_, and pathsToSkip.
Referenced by extractFront(), extractPrime(), and extractSpare().
| PeerConnectionPointer ResolvedPeers::extractFront | ( | ) |
Definition at line 113 of file ResolvedPeers.cc.
References empty(), extractFound(), Must, and start().
Referenced by HappyConnOpener::maybeOpenPrimeConnection().
| PeerConnectionPointer ResolvedPeers::extractPrime | ( | const Comm::Connection & | currentPeer | ) |
extracts and returns the first same-peer same-family address
Definition at line 120 of file ResolvedPeers.cc.
References debugs, extractFound(), findPrime(), and paths_.
Referenced by HappyConnOpener::maybeOpenPrimeConnection().
| PeerConnectionPointer ResolvedPeers::extractSpare | ( | const Comm::Connection & | currentPeer | ) |
extracts and returns the first same-peer different-family address
Definition at line 131 of file ResolvedPeers.cc.
References debugs, extractFound(), findSpare(), and paths_.
Referenced by HappyConnOpener::maybeOpenSpareConnection(), and HappyConnOpener::noteSpareAllowance().
|
private |
Definition at line 104 of file ResolvedPeers.cc.
References Comm::Connection::getPeer(), makeFinding(), paths_, and start().
Referenced by doneWithPeer().
|
private |
Definition at line 72 of file ResolvedPeers.cc.
References ConnectionFamily(), Comm::Connection::getPeer(), makeFinding(), paths_, and start().
Referenced by doneWithPrimes(), and extractPrime().
|
private |
Definition at line 83 of file ResolvedPeers.cc.
References ConnectionFamily(), Comm::Connection::getPeer(), makeFinding(), paths_, and start().
Referenced by doneWithSpares(), extractSpare(), and haveSpare().
| bool ResolvedPeers::haveSpare | ( | const Comm::Connection & | currentPeer | ) |
Definition at line 161 of file ResolvedPeers.cc.
References findSpare(), and paths_.
Referenced by HappyConnOpener::maybeOpenSpareConnection().
|
private |
Definition at line 206 of file ResolvedPeers.cc.
References assert, availablePaths, and paths_.
Referenced by addPath(), and reinstatePath().
|
private |
Definition at line 65 of file ResolvedPeers.cc.
References paths_.
Referenced by findPeer(), findPrime(), and findSpare().
|
inline |
Definition at line 35 of file ResolvedPeers.h.
|
inline |
Definition at line 35 of file ResolvedPeers.h.
|
inlinestaticprivate |
Definition at line 35 of file ResolvedPeers.h.
| void ResolvedPeers::reinstatePath | ( | const PeerConnectionPointer & | path | ) |
makes the previously extracted path available for extraction at its original position
Definition at line 25 of file ResolvedPeers.cc.
References assert, debugs, increaseAvailability(), Must, paths_, pathsToSkip, and PeerConnectionPointer::position_.
Referenced by HappyConnOpener::cancelAttempt(), and FwdState::reactToZeroSizeObject().
|
inline |
Definition at line 79 of file ResolvedPeers.h.
References availablePaths.
Referenced by operator<<().
|
private |
Definition at line 57 of file ResolvedPeers.cc.
References Must, paths_, and pathsToSkip.
Referenced by extractFront(), findPeer(), findPrime(), and findSpare().
|
inlinestatic |
Definition at line 35 of file ResolvedPeers.h.
|
private |
Definition at line 115 of file ResolvedPeers.h.
Referenced by decreaseAvailability(), empty(), increaseAvailability(), and size().
| bool ResolvedPeers::destinationsFinalized = false |
Definition at line 82 of file ResolvedPeers.h.
Referenced by HappyConnOpener::doneAll(), doneWith(), FwdState::noteDestinationsEnd(), TunnelStateData::noteDestinationsEnd(), and operator<<().
| bool ResolvedPeers::notificationPending = false |
Definition at line 85 of file ResolvedPeers.h.
Referenced by FwdState::connectStart(), HappyConnOpener::noteCandidatesChange(), FwdState::notifyConnOpener(), TunnelStateData::notifyConnOpener(), HappyConnOpener::start(), and TunnelStateData::startConnecting().
|
private |
Definition at line 107 of file ResolvedPeers.h.
Referenced by ResolvedPeers(), addPath(), doneWith(), extractFound(), extractPrime(), extractSpare(), findPeer(), findPrime(), findSpare(), haveSpare(), increaseAvailability(), makeFinding(), reinstatePath(), and start().
|
private |
the number of leading paths_ elements that are all currently unavailable i.e. the size of the front paths_ segment comprised of unavailable items i.e. the position of the first available path (or paths_.size())
Definition at line 112 of file ResolvedPeers.h.
Referenced by extractFound(), reinstatePath(), and start().