9#ifndef SQUID_SRC_FWDSTATE_H
10#define SQUID_SRC_FWDSTATE_H
154#if STRICT_ORIGINAL_DST
155 void selectPeerForIntercepted();
168 template <
typename StepStart>
PconnPool * fwdPconnPool
a collection of previously used persistent Squid-to-peer HTTP(S) connections
tos_t aclMapTOS(acl_tos *, ACLChecklist *)
Checks for a TOS value to apply depending on the ACL.
void getOutgoingAddress(HttpRequest *, const Comm::ConnectionPointer &)
RefCount< ResolvedPeers > ResolvedPeersPointer
void GetMarkingsToServer(HttpRequest *request, Comm::Connection &conn)
RefCount< AccessLogEntry > AccessLogEntryPointer
void ResetMarkingsToServer(HttpRequest *, Comm::Connection &)
Ip::NfMarkConfig aclFindNfMarkConfig(acl_nfmark *, ACLChecklist *)
Checks for a netfilter mark value to apply depending on the ACL.
#define RefCountable
The locking interface for use on Reference-Counted classes.
static char server[MAXLINE]
void secureConnectionToPeerIfNeeded(const Comm::ConnectionPointer &)
handles an established TCP connection to peer (including origin servers)
Comm::ConnectionPointer clientConn
a possibly open connection to the client.
void reactToZeroSizeObject()
ERR_ZERO_SIZE_OBJECT requires special adjustments.
void handleUnregisteredServerEnd()
void noteDestinationsEnd(ErrorState *selectionError) override
void connectedToPeer(Security::EncryptorAnswer &answer)
called when all negotiations with the TLS-speaking peer have been completed
void successfullyConnectedToPeer(const Comm::ConnectionPointer &)
called when all negotiations with the peer have been completed
PconnRace pconnRace
current pconn race state
const char * storedWholeReply_
JobWait< HappyConnOpener > transportWait
waits for a transport connection to the peer to be established/opened
JobWait< Http::Tunneler > peerWait
void pconnPush(Comm::ConnectionPointer &conn, const char *domain)
bool transporting() const
PconnRace
possible pconn race states
bool destinationsFound
at least one candidate path found
static void Start(const Comm::ConnectionPointer &client, StoreEntry *, HttpRequest *, const AccessLogEntryPointer &alp)
Initiates request forwarding to a peer or origin server.
void noteDestination(Comm::ConnectionPointer conn) override
called when a new unique destination has been found
static void HandleStoreAbort(FwdState *)
called by Store if the entry is no longer usable
time_t connectingTimeout(const Comm::ConnectionPointer &conn) const
bool connected_okay
TCP link ever opened properly. This affects retry of POST,PUT,CONNECT,etc.
static bool EnoughTimeToReForward(const time_t fwdStart)
void closePendingConnection(const Comm::ConnectionPointer &conn, const char *reason)
get rid of a to-server connection that failed to become serverConn
PeeringActivityTimer peeringTimer
Measures time spent on selecting and communicating with peers.
void unregister(Comm::ConnectionPointer &conn)
void connectDone(const Comm::ConnectionPointer &conn, Comm::Flag status, int xerrno)
void start(Pointer aSelf)
Comm::ConnectionPointer const & serverConnection() const
Comm::ConnectionPointer serverConn
a successfully opened connection to a server.
void fail(ErrorState *err)
static time_t ForwardTimeout(const time_t fwdStart)
time left to finish the whole forwarding process (which started at fwdStart)
void closeServerConnection(const char *reason)
stops monitoring server connection for closure and updates pconn stats
JobWait< Security::PeerConnector > encryptionWait
waits for the established transport connection to be secured/encrypted
void updateAttempts(int)
sets n_tries to the given value (while keeping ALE, if any, in sync)
void usePinned()
send request on an existing connection dedicated to the requesting client
void tunnelEstablishmentDone(Http::TunnelerAnswer &answer)
resumes operations after the (possibly failed) HTTP CONNECT exchange
int n_tries
the number of forwarding attempts so far
AsyncCall::Pointer closeHandler
The serverConn close handler.
static void logReplyStatus(int tries, const Http::StatusCode status)
static void RegisterWithCacheManager(void)
void updateAleWithFinalError()
updates ALE when we finalize the transaction error (if any)
bool exhaustedTries() const
whether we have used up all permitted forwarding attempts
RefCount< FwdState > Pointer
void cancelStep(const char *reason)
struct FwdState::@52 flags
void establishTunnelThruProxy(const Comm::ConnectionPointer &)
void stopAndDestroy(const char *reason)
ends forwarding; relies on refcounting so the effect may not be immediate
bool checkRetriable()
Whether we may try sending this request again after a failure.
void syncWithServerConn(const Comm::ConnectionPointer &server, const char *host, const bool reused)
commits to using the given open to-peer connection
bool waitingForDispatched
whether we are waiting for the last dispatch()ed activity to end
void noteConnection(HappyConnOpenerAnswer &)
ResolvedPeersPointer destinations
paths for forwarding the request
void notifyConnOpener()
makes sure connection opener knows that the destinations have changed
void markStoredReplyAsWhole(const char *whyWeAreSure)
PeerConnectionPointer destinationReceipt
peer selection result (or nil)
void secureConnectionToPeer(const Comm::ConnectionPointer &)
encrypts an established TCP connection to peer (including origin servers)
static void fwdStart(const Comm::ConnectionPointer &client, StoreEntry *, HttpRequest *)
Same as Start() but no master xaction info (AccessLogEntry) available.
void syncHierNote(const Comm::ConnectionPointer &server, const char *host)
AccessLogEntryPointer al
info for the future access.log entry
ErrorState * makeConnectingError(const err_type type) const
bool pinnedCanRetry() const
void advanceDestination(const char *stepDescription, const Comm::ConnectionPointer &conn, const StepStart &startStep)
starts a preparation step for an established connection; retries on failures
Final result (an open connection or an error) sent to the job initiator.
PeerConnectionPointer conn
a netfilter mark/mask pair
Interface for those who need a list of peers to forward a request to.
void stop()
pauses timer if stop() has not been called
Stopwatch & timer()
managed Stopwatch object within HierarchyLogEntry
HttpRequestPointer request
the owner of managed HierarchyLogEntry
~PeeringActivityTimer()
pauses timer if stop() has not been called
bool stopped
Whether the task is done participating in the managed activity.
void pause()
ends the current measurement period if needed; requires prior resume()