#include <UdsOp.h>
Public Types | |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
UdsOp (const String &pathAddr) | |
~UdsOp () override | |
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 void | Start (const Pointer &job) |
static void | RegisterWithCacheManager () |
Public Attributes | |
struct sockaddr_un | address |
UDS address from path; treat as read-only. More... | |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Protected Member Functions | |
Comm::ConnectionPointer & | conn () |
creates if needed and returns raw UDS socket descriptor More... | |
void | setTimeout (time_t seconds, const char *handlerName) |
call timedout() if no UDS messages in a given number of seconds More... | |
void | clearTimeout () |
remove previously set timeout, if any More... | |
void | setOptions (int newOptions) |
changes socket options 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 | start () |
called by AsyncStart; do not call directly More... | |
virtual bool | doneAll () const |
whether positive goal has been reached 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 Member Functions | |
void | noteTimeout (const CommTimeoutCbParams &p) |
Comm timeout callback; calls timedout() More... | |
UdsOp (const UdsOp &) | |
UdsOp & | operator= (const UdsOp &) |
virtual void | finalizedInCbdataChild ()=0 |
hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More... | |
Private Attributes | |
int | options |
UDS options. More... | |
Comm::ConnectionPointer | conn_ |
UDS descriptor. More... | |
Detailed Description
code shared by unix-domain socket senders (e.g., UdsSender or Coordinator) and receivers (e.g. Port or Coordinator)
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ UdsOp() [1/2]
Ipc::UdsOp::UdsOp | ( | const String & | pathAddr | ) |
◆ ~UdsOp()
|
override |
Definition at line 27 of file UdsOp.cc.
References debugs, and Comm::IsConnOpen().
◆ UdsOp() [2/2]
|
private |
Member Function Documentation
◆ 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.
◆ clearTimeout()
|
protected |
Definition at line 62 of file UdsOp.cc.
References commUnsetConnTimeout().
◆ conn()
|
protected |
Definition at line 41 of file UdsOp.cc.
References COMM_DOBIND, comm_open_uds(), Comm::IsConnOpen(), and Must.
◆ 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()
|
protectedvirtualinherited |
Reimplemented in Adaptation::Icap::ModXact, ConnStateData, ClientHttpRequest, HappyConnOpener, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Adaptation::Ecap::XactionRep, Ipc::UdsSender, Client, Rock::Rebuild, Adaptation::AccessCheck, Adaptation::Icap::Launcher, Security::PeerConnector, Downloader, Log::TcpLogger, Http::Tunneler, Adaptation::Iterator, Ipc::Forwarder, Comm::TcpAcceptor, Ipc::Inquirer, Rock::HeaderUpdater, PeerPoolMgr, Mgr::StoreToCommWriter, Server, Mgr::Inquirer, Snmp::Inquirer, BodySink, Ipc::Port, and Comm::ConnOpener.
Definition at line 112 of file AsyncJob.cc.
Referenced by AsyncJob::done(), Comm::ConnOpener::doneAll(), BodySink::doneAll(), Server::doneAll(), PeerPoolMgr::doneAll(), Rock::HeaderUpdater::doneAll(), Comm::TcpAcceptor::doneAll(), Adaptation::Iterator::doneAll(), Log::TcpLogger::doneAll(), Downloader::doneAll(), Security::PeerConnector::doneAll(), Adaptation::Icap::Launcher::doneAll(), Rock::Rebuild::doneAll(), Client::doneAll(), Ipc::UdsSender::doneAll(), Adaptation::Ecap::XactionRep::doneAll(), Adaptation::Icap::Xaction::doneAll(), Adaptation::Icap::ServiceRep::doneAll(), ClientHttpRequest::doneAll(), and ConnStateData::doneAll().
◆ finalizedInCbdataChild()
|
privatepure virtualinherited |
◆ handleStopRequest()
|
inlineinherited |
Definition at line 73 of file AsyncJob.h.
References AsyncJob::mustStop().
◆ 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().
◆ noteTimeout()
|
private |
Definition at line 67 of file UdsOp.cc.
Referenced by setTimeout().
◆ operator=()
◆ 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().
◆ setOptions()
|
protected |
Definition at line 35 of file UdsOp.cc.
Referenced by Ipc::Port::Port().
◆ setTimeout()
|
protected |
Definition at line 54 of file UdsOp.cc.
References asyncCall(), commSetConnTimeout(), and noteTimeout().
◆ start()
|
protectedvirtualinherited |
Reimplemented in Ipc::Port, ConnStateData, Adaptation::Icap::ModXact, Ftp::Client, HappyConnOpener, Ftp::Gateway, Ftp::Server, HttpStateData, Adaptation::Ecap::XactionRep, Ipc::UdsSender, Adaptation::Icap::Xaction, Rock::Rebuild, Downloader, Adaptation::AccessCheck, Adaptation::Icap::Launcher, Security::PeerConnector, Ftp::Relay, Log::TcpLogger, Http::Tunneler, Adaptation::Iterator, Http::One::Server, Ipc::Forwarder, Comm::TcpAcceptor, Ipc::Coordinator, Ipc::Inquirer, Rock::HeaderUpdater, Comm::ConnOpener, PeerPoolMgr, Mgr::StoreToCommWriter, Server, Mgr::Inquirer, Snmp::Inquirer, Adaptation::Icap::OptXact, Ipc::Strand, Mgr::Filler, and Mgr::ActionWriter.
Definition at line 59 of file AsyncJob.cc.
Referenced by Ipc::Port::start(), PeerPoolMgr::start(), AsyncJob::Start(), Adaptation::Iterator::start(), Http::Tunneler::start(), Adaptation::Icap::Launcher::start(), Security::PeerConnector::start(), Adaptation::AccessCheck::start(), Adaptation::Icap::Xaction::start(), Ipc::UdsSender::start(), and ConnStateData::start().
◆ Start()
|
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(), Adaptation::AccessCheck::Start(), CacheManager::start(), Rock::Rebuild::Start(), JobWaitBase::start_(), BodyPipe::startAutoConsumptionIfNeeded(), Ftp::StartGateway(), Ftp::StartRelay(), and Rock::SwapDir::updateHeaders().
◆ 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().
Member Data Documentation
◆ address
struct sockaddr_un Ipc::UdsOp::address |
Definition at line 37 of file UdsOp.h.
Referenced by Ipc::UdsSender::UdsSender().
◆ conn_
|
private |
◆ 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().
◆ options
◆ 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().
◆ 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:
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