#include <AccessCheck.h>
![Inheritance graph](classAdaptation_1_1AccessCheck__inherit__graph.png)
![Collaboration graph](classAdaptation_1_1AccessCheck__coll__graph.png)
Public Types | |
typedef void | AccessCheckCallback(ServiceGroupPointer group, void *data) |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
void | checkCandidates () |
void | noteAnswer (Acl::Answer answer) |
process the results of the ACL check More... | |
bool | canBeCalled (AsyncCall &call) const |
whether we can be called More... | |
void | callStart (AsyncCall &call) |
virtual void | callEnd () |
called right after the called job method More... | |
virtual void | callException (const std::exception &e) |
called when the job throws during an async call More... | |
void | handleStopRequest () |
process external request to terminate now (i.e. during this async call) More... | |
virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
static bool | Start (Method method, VectPoint vp, HttpRequest *req, HttpReply *, const AccessLogEntryPointer &, Adaptation::Initiator *) |
static void | AccessCheckCallbackWrapper (Acl::Answer, void *) |
static void | Start (const Pointer &job) |
static void | RegisterWithCacheManager () |
Public Attributes | |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Protected Member Functions | |
AccessCheck (const ServiceFilter &aFilter, Adaptation::Initiator *) | |
~AccessCheck () override | |
void | start () override |
called by AsyncStart; do not call directly More... | |
bool | doneAll () const override |
whether positive goal has been reached More... | |
bool | usedDynamicRules () |
not done until mustStop More... | |
void | check () |
Walk the access rules list to find rules with applicable service groups. More... | |
void | deleteThis (const char *aReason) |
void | mustStop (const char *aReason) |
bool | done () const |
the job is destroyed in callEnd() when done() More... | |
virtual void | swanSong () |
virtual const char * | status () const |
internal cleanup; do not call directly More... | |
Static Protected Member Functions | |
static void | ReportAllJobs (StoreEntry *) |
writes a cache manager report about all jobs existing in this worker More... | |
Protected Attributes | |
const char * | stopReason |
reason for forcing done() to be true More... | |
const char * | typeName |
kid (leaf) class name, for debugging More... | |
AsyncCall::Pointer | inCall |
the asynchronous call being handled, if any More... | |
bool | started_ = false |
Start() has finished successfully. More... | |
bool | swanSang_ = false |
swanSong() was called More... | |
Private Types | |
typedef int | Candidate |
typedef std::vector< Candidate > | Candidates |
Private Member Functions | |
CBDATA_CHILD (AccessCheck) | |
Candidate | topCandidate () const |
ServiceGroupPointer | topGroup () const |
void | callBack (const ServiceGroupPointer &g) |
bool | isCandidate (AccessRule &r) |
virtual void | finalizedInCbdataChild ()=0 |
hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More... | |
Private Attributes | |
const ServiceFilter | filter |
CbcPointer< Adaptation::Initiator > | theInitiator |
the job which ordered this access check More... | |
Candidates | candidates |
Detailed Description
Definition at line 30 of file AccessCheck.h.
Member Typedef Documentation
◆ AccessCheckCallback
typedef void Adaptation::AccessCheck::AccessCheckCallback(ServiceGroupPointer group, void *data) |
Definition at line 35 of file AccessCheck.h.
◆ Candidate
|
private |
Definition at line 50 of file AccessCheck.h.
◆ Candidates
|
private |
Definition at line 51 of file AccessCheck.h.
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ AccessCheck()
|
protected |
Definition at line 46 of file AccessCheck.cc.
References debugs, filter, HttpRequest::icapHistory(), and Adaptation::ServiceFilter::request.
Referenced by Start().
◆ ~AccessCheck()
|
overrideprotected |
Definition at line 60 of file AccessCheck.cc.
Member Function Documentation
◆ AccessCheckCallbackWrapper()
|
static |
Definition at line 148 of file AccessCheck.cc.
References asyncCall(), debugs, noteAnswer(), and ScheduleCallHere.
◆ callBack()
|
private |
call back with a possibly nil group; the job ends here because all failures at this point are fatal to the access check process
Definition at line 191 of file AccessCheck.cc.
References CallJobHere1, and debugs.
◆ callEnd()
|
virtualinherited |
called right after the called job method
Reimplemented in Adaptation::Icap::Xaction.
Definition at line 152 of file AsyncJob.cc.
References assert, AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::done(), AsyncJob::inCall, AsyncJob::started_, AsyncJob::status(), AsyncJob::swanSang_, AsyncJob::swanSong(), and AsyncJob::typeName.
Referenced by Adaptation::Icap::Xaction::callEnd(), and AsyncJob::deleteThis().
◆ callException()
|
virtualinherited |
Reimplemented in Adaptation::Icap::ModXact, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Ftp::Server, Ipc::Forwarder, Ipc::Inquirer, ConnStateData, ClientHttpRequest, and Rock::Rebuild.
Definition at line 143 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, AsyncJob::mustStop(), and CbdataParent::toCbdata().
Referenced by Ipc::Inquirer::callException(), Ipc::Forwarder::callException(), Ftp::Server::callException(), Adaptation::Icap::Xaction::callException(), and ConnStateData::callException().
◆ callStart()
|
inherited |
called just before the called method
Definition at line 130 of file AsyncJob.cc.
References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::inCall, Must, AsyncJob::status(), CbdataParent::toCbdata(), and AsyncJob::typeName.
◆ canBeCalled()
|
inherited |
Definition at line 117 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, and AsyncJob::inCall.
◆ CBDATA_CHILD()
|
private |
◆ check()
|
protected |
Definition at line 102 of file AccessCheck.cc.
References Adaptation::AllRules(), debugs, and Adaptation::AccessRule::id.
◆ checkCandidates()
void Adaptation::AccessCheck::checkCandidates | ( | ) |
Definition at line 124 of file AccessCheck.cc.
References debugs, Adaptation::FindRule(), ACLFilledChecklist::Make(), Must, and ACLFilledChecklist::NonBlockingCheck().
◆ deleteThis()
|
protectedinherited |
Definition at line 65 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::inCall, JobMemFun(), Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by ConnStateData::connStateClosed().
◆ done()
|
protectedinherited |
Definition at line 106 of file AsyncJob.cc.
References AsyncJob::doneAll(), and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), HappyConnOpener::checkForNewConnection(), Downloader::downloadFinished(), and HappyConnOpener::maybeOpenPrimeConnection().
◆ doneAll()
|
inlineoverrideprotectedvirtual |
Reimplemented from AsyncJob.
Definition at line 67 of file AccessCheck.h.
◆ finalizedInCbdataChild()
|
privatepure virtualinherited |
◆ handleStopRequest()
|
inlineinherited |
Definition at line 73 of file AsyncJob.h.
References AsyncJob::mustStop().
◆ isCandidate()
|
private |
Returns true iff the rule's service group will be used after ACL matches. Used to detect rules worth ACl-checking.
Definition at line 220 of file AccessCheck.cc.
References debugs, Adaptation::FindGroup(), Adaptation::AccessRule::groupId, Adaptation::AccessRule::id, and Adaptation::ServiceGroup::wants().
◆ mustStop()
|
protectedinherited |
Definition at line 85 of file AsyncJob.cc.
References debugs, AsyncJob::inCall, Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by HttpStateData::abortAll(), AsyncJob::callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), AsyncJob::handleStopRequest(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ noteAnswer()
void Adaptation::AccessCheck::noteAnswer | ( | Acl::Answer | answer | ) |
Definition at line 169 of file AccessCheck.cc.
References Acl::Answer::allowed(), debugs, and Must.
Referenced by AccessCheckCallbackWrapper().
◆ RegisterWithCacheManager()
|
staticinherited |
Definition at line 215 of file AsyncJob.cc.
References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().
Referenced by mainInitialize().
◆ ReportAllJobs()
|
staticprotectedinherited |
Definition at line 198 of file AsyncJob.cc.
References AllJobs().
Referenced by AsyncJob::RegisterWithCacheManager().
◆ start()
|
overrideprotectedvirtual |
Reimplemented from AsyncJob.
Definition at line 70 of file AccessCheck.cc.
References AsyncJob::start().
◆ Start() [1/2]
|
staticinherited |
Promises to start the configured job (eventually). The job is deemed to be running asynchronously beyond this point, so the caller should only access the job object via AsyncCalls rather than directly.
swanSong() is only called for jobs for which this method has returned successfully (i.e. without throwing).
Definition at line 37 of file AsyncJob.cc.
References CallJobHere, AsyncJob::start(), and AsyncJob::started_.
Referenced by Ftp::Server::AcceptCtrlConnection(), clientListenerConnectionOpened(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Log::TcpLogger::Open(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), Start(), CacheManager::start(), Rock::Rebuild::Start(), JobWaitBase::start_(), BodyPipe::startAutoConsumptionIfNeeded(), Ftp::StartGateway(), Ftp::StartRelay(), and Rock::SwapDir::updateHeaders().
◆ Start() [2/2]
|
static |
Definition at line 30 of file AccessCheck.cc.
References AccessCheck(), debugs, Adaptation::Config::Enabled, and AsyncJob::Start().
Referenced by Client::adaptOrFinalizeReply(), and ClientHttpRequest::doCallouts().
◆ status()
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented in Adaptation::Icap::ServiceRep, HappyConnOpener, Adaptation::Icap::Xaction, Adaptation::Ecap::XactionRep, Security::PeerConnector, Http::Tunneler, Adaptation::Initiate, Comm::TcpAcceptor, and Ipc::Inquirer.
Definition at line 182 of file AsyncJob.cc.
References MemBuf::append(), Packable::appendf(), MemBuf::content(), MemBuf::reset(), AsyncJob::stopReason, and MemBuf::terminate().
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), Comm::TcpAcceptor::status(), and Adaptation::Initiate::status().
◆ swanSong()
|
inlineprotectedvirtualinherited |
Reimplemented in Adaptation::Icap::ModXactLauncher, Adaptation::Icap::ModXact, ConnStateData, HappyConnOpener, Adaptation::Icap::Xaction, Adaptation::Ecap::XactionRep, Client, Ipc::UdsSender, Rock::Rebuild, Adaptation::Icap::Launcher, Security::PeerConnector, Ftp::Relay, Log::TcpLogger, Http::Tunneler, Downloader, Adaptation::Iterator, Comm::TcpAcceptor, Ipc::Forwarder, Adaptation::Initiate, Ipc::Inquirer, Adaptation::Icap::OptXact, Rock::HeaderUpdater, Mgr::Forwarder, Comm::ConnOpener, PeerPoolMgr, Mgr::StoreToCommWriter, Server, Snmp::Forwarder, and Mgr::Filler.
Definition at line 61 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), Server::swanSong(), Comm::ConnOpener::swanSong(), PeerPoolMgr::swanSong(), Rock::HeaderUpdater::swanSong(), Comm::TcpAcceptor::swanSong(), Http::Tunneler::swanSong(), Log::TcpLogger::swanSong(), Security::PeerConnector::swanSong(), Ipc::UdsSender::swanSong(), Client::swanSong(), and HappyConnOpener::swanSong().
◆ toCbdata()
|
pure virtualinherited |
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
◆ topCandidate()
|
inlineprivate |
Definition at line 53 of file AccessCheck.h.
References candidates.
◆ topGroup()
|
private |
Definition at line 200 of file AccessCheck.cc.
References debugs, Adaptation::FindGroup(), and Adaptation::FindRule().
◆ usedDynamicRules()
|
protected |
returns true if previous services configured dynamic chaining "rules"
Definition at line 80 of file AccessCheck.cc.
References debugs, Adaptation::History::extractCurrentServices(), and Must.
Member Data Documentation
◆ candidates
|
private |
Definition at line 52 of file AccessCheck.h.
Referenced by topCandidate().
◆ filter
|
private |
Definition at line 47 of file AccessCheck.h.
Referenced by AccessCheck().
◆ id
|
inherited |
Definition at line 75 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 86 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ started_
|
protectedinherited |
Definition at line 88 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::Start(), and AsyncJob::~AsyncJob().
◆ stopReason
|
protectedinherited |
Definition at line 84 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ swanSang_
|
protectedinherited |
Definition at line 89 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), and AsyncJob::~AsyncJob().
◆ theInitiator
|
private |
Definition at line 48 of file AccessCheck.h.
◆ typeName
|
protectedinherited |
Definition at line 85 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), AsyncJob::mustStop(), Adaptation::Icap::Xaction::Xaction(), and AsyncJob::~AsyncJob().
The documentation for this class was generated from the following files:
- src/adaptation/AccessCheck.h
- src/adaptation/AccessCheck.cc
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