|
Squid Web Cache master
|
sends a single control message, notifying the Sink More...
#include <HttpControlMsg.h>
Public Types | |
| typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
| HttpControlMsgSink () | |
| virtual void | sendControlMsg (HttpControlMsg msg)=0 |
| called to send the 1xx message and notify the Source | |
| virtual void | doneWithControlMsg () |
| void | wroteControlMsg (const CommIoCbParams &) |
| callback to handle Comm::Write completion | |
| bool | canBeCalled (AsyncCall &call) const |
| whether we can be called | |
| void | callStart (AsyncCall &call) |
| virtual void | callEnd () |
| called right after the called job method | |
| virtual void | callException (const std::exception &e) |
| called when the job throws during an async call | |
| void | handleStopRequest () |
| process external request to terminate now (i.e. during this async call) | |
| virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
| static void | Start (const Pointer &job) |
| static void | RegisterWithCacheManager () |
Public Attributes | |
| AsyncCall::Pointer | cbControlMsgSent |
| Call to schedule when the control msg has been sent. | |
| const InstanceId< AsyncJob > | id |
| job identifier | |
Protected Member Functions | |
| void | deleteThis (const char *aReason) |
| void | mustStop (const char *aReason) |
| bool | done () const |
| the job is destroyed in callEnd() when done() | |
| virtual void | start () |
| called by AsyncStart; do not call directly | |
| virtual bool | doneAll () const |
| whether positive goal has been reached | |
| virtual void | swanSong () |
| virtual const char * | status () const |
| internal cleanup; do not call directly | |
Static Protected Member Functions | |
| static void | ReportAllJobs (StoreEntry *) |
| writes a cache manager report about all jobs existing in this worker | |
Protected Attributes | |
| const char * | stopReason |
| reason for forcing done() to be true | |
| const char * | typeName |
| kid (leaf) class name, for debugging | |
| AsyncCall::Pointer | inCall |
| the asynchronous call being handled, if any | |
| bool | started_ = false |
| Start() has finished successfully. | |
| bool | swanSang_ = false |
| swanSong() was called | |
Private Member Functions | |
| virtual void | finalizedInCbdataChild ()=0 |
| hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() | |
Definition at line 28 of file HttpControlMsg.h.
|
inherited |
Definition at line 34 of file AsyncJob.h.
|
inline |
Definition at line 31 of file HttpControlMsg.h.
|
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().
|
virtualinherited |
Reimplemented in ConnStateData, ClientHttpRequest, Rock::Rebuild, Adaptation::Icap::ModXact, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Ipc::Forwarder, Ipc::Inquirer, and Ftp::Server.
Definition at line 143 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, AsyncJob::mustStop(), and CbdataParent::toCbdata().
Referenced by ConnStateData::callException(), Adaptation::Icap::Xaction::callException(), Ipc::Forwarder::callException(), Ipc::Inquirer::callException(), and Ftp::Server::callException().
|
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.
|
inherited |
Definition at line 117 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, and AsyncJob::inCall.
|
protectedinherited |
Definition at line 65 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::deleteThis(), AsyncJob::inCall, JobMemFun(), Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by ConnStateData::connStateClosed(), and AsyncJob::deleteThis().
|
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().
|
protectedvirtualinherited |
Reimplemented in Adaptation::AccessCheck, Adaptation::Ecap::XactionRep, Adaptation::Icap::Launcher, Adaptation::Icap::ModXact, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Adaptation::Iterator, BodySink, ConnStateData, ClientHttpRequest, Client, Http::Tunneler, Comm::ConnOpener, Comm::TcpAcceptor, Downloader, Rock::HeaderUpdater, Rock::Rebuild, HappyConnOpener, Ipc::Forwarder, Ipc::Inquirer, Ipc::Port, Ipc::UdsSender, Log::TcpLogger, Mgr::Inquirer, Mgr::StoreToCommWriter, PeerPoolMgr, Security::PeerConnector, Server, and Snmp::Inquirer.
Definition at line 112 of file AsyncJob.cc.
Referenced by AsyncJob::done(), Adaptation::Ecap::XactionRep::doneAll(), Adaptation::Icap::Launcher::doneAll(), Adaptation::Icap::ServiceRep::doneAll(), Adaptation::Icap::Xaction::doneAll(), Adaptation::Iterator::doneAll(), BodySink::doneAll(), ConnStateData::doneAll(), ClientHttpRequest::doneAll(), Client::doneAll(), Comm::ConnOpener::doneAll(), Comm::TcpAcceptor::doneAll(), Downloader::doneAll(), Rock::HeaderUpdater::doneAll(), Rock::Rebuild::doneAll(), Ipc::UdsSender::doneAll(), Log::TcpLogger::doneAll(), PeerPoolMgr::doneAll(), Security::PeerConnector::doneAll(), and Server::doneAll().
|
virtual |
Reimplemented in ConnStateData.
Definition at line 15 of file HttpControlMsg.cc.
References cbControlMsgSent, and ScheduleCallHere.
Referenced by ConnStateData::doneWithControlMsg(), and wroteControlMsg().
|
privatepure virtualinherited |
|
inlineinherited |
Definition at line 73 of file AsyncJob.h.
References AsyncJob::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(), AsyncJob::handleStopRequest(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
|
staticinherited |
Definition at line 215 of file AsyncJob.cc.
References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().
Referenced by mainInitialize().
|
staticprotectedinherited |
Definition at line 198 of file AsyncJob.cc.
References AllJobs().
Referenced by AsyncJob::RegisterWithCacheManager().
|
pure virtual |
Implemented in ConnStateData.
|
protectedvirtualinherited |
Reimplemented in Adaptation::AccessCheck, Adaptation::Ecap::XactionRep, Adaptation::Icap::Launcher, Adaptation::Icap::ModXact, Adaptation::Icap::OptXact, Adaptation::Icap::Xaction, Adaptation::Iterator, ConnStateData, Ftp::Client, Ftp::Gateway, Ftp::Relay, Http::Tunneler, Comm::ConnOpener, Comm::TcpAcceptor, Downloader, Rock::HeaderUpdater, Rock::Rebuild, HappyConnOpener, HttpStateData, Ipc::Coordinator, Ipc::Forwarder, Ipc::Inquirer, Ipc::Strand, Ipc::UdsSender, Log::TcpLogger, Mgr::ActionWriter, Mgr::Filler, Mgr::Inquirer, Mgr::StoreToCommWriter, PeerPoolMgr, Security::PeerConnector, Ftp::Server, Http::One::Server, Server, Snmp::Inquirer, and Ipc::Port.
Definition at line 59 of file AsyncJob.cc.
Referenced by Adaptation::AccessCheck::start(), Adaptation::Icap::Launcher::start(), Adaptation::Icap::Xaction::start(), Adaptation::Iterator::start(), ConnStateData::start(), Http::Tunneler::start(), Ipc::UdsSender::start(), PeerPoolMgr::start(), Security::PeerConnector::start(), Ipc::Port::start(), and AsyncJob::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(), CacheManager::start(), Adaptation::AccessCheck::Start(), Rock::Rebuild::Start(), JobWaitBase::start_(), BodyPipe::startAutoConsumptionIfNeeded(), Ftp::StartGateway(), Ftp::StartRelay(), and Rock::SwapDir::updateHeaders().
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented in Adaptation::Ecap::XactionRep, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Adaptation::Initiate, Http::Tunneler, Comm::TcpAcceptor, HappyConnOpener, Ipc::Inquirer, and Security::PeerConnector.
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(), Adaptation::Initiate::status(), and Comm::TcpAcceptor::status().
|
inlineprotectedvirtualinherited |
Reimplemented in Adaptation::Ecap::XactionRep, Adaptation::Icap::Launcher, Adaptation::Icap::ModXact, Adaptation::Icap::ModXactLauncher, Adaptation::Icap::OptXact, Adaptation::Icap::Xaction, Adaptation::Initiate, Adaptation::Iterator, ConnStateData, Client, Ftp::Relay, Http::Tunneler, Comm::ConnOpener, Comm::TcpAcceptor, Downloader, Rock::HeaderUpdater, Rock::Rebuild, HappyConnOpener, Ipc::Forwarder, Ipc::Inquirer, Ipc::UdsSender, Log::TcpLogger, Mgr::Filler, Mgr::Forwarder, Mgr::StoreToCommWriter, PeerPoolMgr, Security::PeerConnector, Server, and Snmp::Forwarder.
Definition at line 61 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), Client::swanSong(), Ftp::Relay::swanSong(), Http::Tunneler::swanSong(), Comm::ConnOpener::swanSong(), Comm::TcpAcceptor::swanSong(), Rock::HeaderUpdater::swanSong(), HappyConnOpener::swanSong(), Ipc::UdsSender::swanSong(), Log::TcpLogger::swanSong(), PeerPoolMgr::swanSong(), Security::PeerConnector::swanSong(), and Server::swanSong().
|
pure virtualinherited |
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
| void HttpControlMsgSink::wroteControlMsg | ( | const CommIoCbParams & | params | ) |
called when we wrote the 1xx response
Definition at line 25 of file HttpControlMsg.cc.
References Comm::Connection::close(), CommCommonCbParams::conn, debugs, doneWithControlMsg(), Comm::ERR_CLOSING, CommCommonCbParams::flag, Comm::OK, CommCommonCbParams::xerrno, and xstrerr().
Referenced by ConnStateData::sendControlMsg().
| AsyncCall::Pointer HttpControlMsgSink::cbControlMsgSent |
Definition at line 42 of file HttpControlMsg.h.
Referenced by clientSocketRecipient(), doneWithControlMsg(), and ConnStateData::sendControlMsg().
|
inherited |
Definition at line 75 of file AsyncJob.h.
|
protectedinherited |
Definition at line 86 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
|
protectedinherited |
Definition at line 88 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().
|
protectedinherited |
Definition at line 84 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
|
protectedinherited |
Definition at line 89 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().
|
protectedinherited |
Definition at line 85 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), and AsyncJob::mustStop().