#include <ActionWriter.h>


Public Types | |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
ActionWriter (const Action::Pointer &anAction, const Comm::ConnectionPointer &conn) | |
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... | |
virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
static Pointer | Start (AsyncJob *job) |
starts a freshly created job (i.e., makes the job asynchronous) More... | |
Protected Member Functions | |
virtual void | start () |
called by AsyncStart; do not call directly More... | |
virtual void | swanSong () |
virtual bool | doneAll () const |
whether positive goal has been reached More... | |
void | scheduleStoreCopy () |
request more action results from the store More... | |
void | noteStoreCopied (StoreIOBuffer ioBuf) |
receive some action results from the store More... | |
void | scheduleCommWrite (const StoreIOBuffer &ioBuf) |
tell Comm to write action results More... | |
void | noteCommWrote (const CommIoCbParams ¶ms) |
called by Comm after the action results are written More... | |
void | noteCommClosed (const CommCloseCbParams ¶ms) |
called by Comm if the client socket got closed More... | |
void | close () |
closes the local connection to the HTTP client, if any More... | |
void | deleteThis (const char *aReason) |
void | mustStop (const char *aReason) |
bool | done () const |
the job is destroyed in callEnd() when done() More... | |
virtual const char * | status () const |
internal cleanup; do not call directly More... | |
Static Protected Member Functions | |
static void | NoteStoreCopied (void *data, StoreIOBuffer ioBuf) |
static void | Abort (void *param) |
called by Store if the entry is no longer usable More... | |
Protected Attributes | |
Comm::ConnectionPointer | clientConnection |
HTTP client descriptor. More... | |
StoreEntry * | entry |
store entry with the cache manager response More... | |
store_client * | sc |
our registration with the store More... | |
int64_t | writeOffset |
number of bytes written to the client More... | |
AsyncCall::Pointer | closer |
comm_close handler More... | |
char | buffer [HTTP_REQBUF_SZ] |
action results; Store fills, Comm writes More... | |
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... | |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Private Member Functions | |
CBDATA_CLASS (ActionWriter) | |
Private Attributes | |
Action::Pointer | action |
action that fills the entry More... | |
Detailed Description
Creates Store entry, fills it using action's fillEntry(), and Comm-writes it using parent StoreToCommWriter.
Definition at line 22 of file ActionWriter.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ ActionWriter()
Mgr::ActionWriter::ActionWriter | ( | const Action::Pointer & | anAction, |
const Comm::ConnectionPointer & | conn | ||
) |
Definition at line 19 of file ActionWriter.cc.
Member Function Documentation
◆ Abort()
|
staticprotectedinherited |
Definition at line 161 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::clientConnection, Comm::Connection::close(), and Comm::IsConnOpen().
Referenced by Mgr::StoreToCommWriter::start().
◆ callEnd()
|
virtualinherited |
called right after the called job method
Reimplemented in Adaptation::Icap::Xaction.
Definition at line 136 of file AsyncJob.cc.
References AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::done(), HERE(), AsyncJob::inCall, NULL, AsyncJob::status(), AsyncJob::swanSong(), and AsyncJob::typeName.
Referenced by Adaptation::Icap::Xaction::callEnd(), AsyncJob::deleteThis(), and AsyncJob::swanSong().
◆ callException()
|
virtualinherited |
Reimplemented in ClientHttpRequest, Adaptation::Icap::ModXact, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Ftp::Server, Ipc::Forwarder, and Ipc::Inquirer.
Definition at line 127 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 AsyncJob::swanSong().
◆ callStart()
|
inherited |
called just before the called method
Definition at line 114 of file AsyncJob.cc.
References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::inCall, Must, AsyncJob::status(), CbdataParent::toCbdata(), and AsyncJob::typeName.
Referenced by AsyncJob::swanSong().
◆ canBeCalled()
|
inherited |
Definition at line 101 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.
Referenced by AsyncJob::swanSong().
◆ CBDATA_CLASS()
|
private |
◆ close()
|
protectedinherited |
closes our copy of the client HTTP connection socket
Definition at line 43 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::clientConnection, Comm::Connection::close(), Mgr::StoreToCommWriter::closer, comm_remove_close_handler(), Comm::Connection::fd, Comm::IsConnOpen(), and NULL.
Referenced by Mgr::StoreToCommWriter::swanSong(), and Mgr::StoreToCommWriter::~StoreToCommWriter().
◆ deleteThis()
|
protectedinherited |
Definition at line 49 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::inCall, JobMemFun(), Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.
◆ done()
|
protectedinherited |
Definition at line 90 of file AsyncJob.cc.
References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.
Referenced by Adaptation::Ecap::XactionRep::blockVirgin(), AsyncJob::callEnd(), Adaptation::AccessCheck::checkCandidates(), Rock::Rebuild::checkpoint(), Downloader::downloadFinished(), Comm::TcpAcceptor::handleClosure(), Adaptation::Icap::OptXact::handleCommRead(), Ipc::Inquirer::handleRemoteAck(), Ipc::Inquirer::inquire(), Adaptation::Icap::Launcher::noteAdaptationAnswer(), Adaptation::AccessCheck::noteAnswer(), Adaptation::Icap::Launcher::noteInitiatorAborted(), Adaptation::Icap::Launcher::noteXactAbort(), Ipc::Inquirer::requestTimedOut(), Adaptation::Iterator::step(), Adaptation::AccessCheck::usedDynamicRules(), and Adaptation::Ecap::XactionRep::useVirgin().
◆ doneAll()
|
protectedvirtualinherited |
Reimplemented from AsyncJob.
Definition at line 153 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::entry, StoreEntry::objectLen(), STORE_OK, StoreEntry::store_status, and Mgr::StoreToCommWriter::writeOffset.
Referenced by Mgr::StoreToCommWriter::noteCommWrote(), and Mgr::StoreToCommWriter::noteStoreCopied().
◆ mustStop()
|
protectedinherited |
Definition at line 69 of file AsyncJob.cc.
References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), Adaptation::Ecap::XactionRep::noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().
◆ noteCommClosed()
|
protectedinherited |
Definition at line 129 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::clientConnection, debugs, HERE(), Comm::IsConnOpen(), Must, and AsyncJob::mustStop().
Referenced by Mgr::StoreToCommWriter::StoreToCommWriter().
◆ noteCommWrote()
|
protectedinherited |
Definition at line 117 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::clientConnection, debugs, Mgr::StoreToCommWriter::doneAll(), CommCommonCbParams::fd, Comm::Connection::fd, CommCommonCbParams::flag, HERE(), Must, NULL, Comm::OK, Mgr::StoreToCommWriter::scheduleStoreCopy(), CommIoCbParams::size, and Mgr::StoreToCommWriter::writeOffset.
Referenced by Mgr::StoreToCommWriter::scheduleCommWrite().
◆ noteStoreCopied()
|
protectedinherited |
Definition at line 92 of file StoreToCommWriter.cc.
References debugs, Mgr::StoreToCommWriter::doneAll(), StoreIOBuffer::error, StoreIOBuffer::flags, HERE(), StoreIOBuffer::length, Must, and Mgr::StoreToCommWriter::scheduleCommWrite().
Referenced by Mgr::StoreToCommWriter::NoteStoreCopied().
◆ NoteStoreCopied()
|
staticprotectedinherited |
Definition at line 79 of file StoreToCommWriter.cc.
References asyncCall(), data, Must, Mgr::StoreToCommWriter::noteStoreCopied(), NULL, and ScheduleCallHere.
Referenced by Mgr::StoreToCommWriter::scheduleStoreCopy().
◆ scheduleCommWrite()
|
protectedinherited |
Definition at line 103 of file StoreToCommWriter.cc.
References asyncCall(), Mgr::StoreToCommWriter::clientConnection, StoreIOBuffer::data, debugs, HERE(), Comm::IsConnOpen(), StoreIOBuffer::length, Must, Mgr::StoreToCommWriter::noteCommWrote(), NULL, and Comm::Write().
Referenced by Mgr::StoreToCommWriter::noteStoreCopied().
◆ scheduleStoreCopy()
|
protectedinherited |
Definition at line 69 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::buffer, debugs, Mgr::StoreToCommWriter::entry, HERE(), Must, Mgr::StoreToCommWriter::NoteStoreCopied(), NULL, Mgr::StoreToCommWriter::sc, storeClientCopy(), and Mgr::StoreToCommWriter::writeOffset.
Referenced by Mgr::StoreToCommWriter::noteCommWrote(), and Mgr::StoreToCommWriter::start().
◆ start()
|
protectedvirtual |
Reimplemented from Mgr::StoreToCommWriter.
Definition at line 27 of file ActionWriter.cc.
References action, debugs, Mgr::StoreToCommWriter::entry, HERE(), Must, NULL, and Mgr::StoreToCommWriter::start().
◆ Start()
|
staticinherited |
Definition at line 23 of file AsyncJob.cc.
References CallJobHere, and AsyncJob::start().
Referenced by Ftp::Server::AcceptCtrlConnection(), Ftp::Server::checkDataConnPre(), clientListenerConnectionOpened(), Ftp::Client::connectDataChannel(), FwdState::connectDone(), FwdState::connectStart(), TunnelStateData::connectToPeer(), Adaptation::Icap::Xaction::dnsLookupDone(), Log::TcpLogger::doConnect(), Ipc::Coordinator::handleCacheMgrRequest(), PeerPoolMgr::handleOpenedConnection(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Adaptation::Initiator::initiateAdaptation(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Adaptation::Icap::Xaction::noteCommConnected(), Log::TcpLogger::Open(), PeerPoolMgr::openNewConnection(), peerProbeConnect(), Rock::SwapDir::rebuild(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), Ident::Start(), Adaptation::AccessCheck::Start(), CacheManager::Start(), Security::PeerConnector::startCertDownloading(), TunnelStateData::startConnecting(), Ftp::StartGateway(), Ftp::StartRelay(), PeerPoolMgrsRr::syncConfig(), and Rock::SwapDir::updateHeaders().
◆ status()
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented in Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Security::PeerConnector, Adaptation::Ecap::XactionRep, Adaptation::Initiate, Comm::TcpAcceptor, and Ipc::Inquirer.
Definition at line 159 of file AsyncJob.cc.
References MemBuf::append(), Packable::appendf(), buf, MemBuf::content(), NULL, MemBuf::reset(), AsyncJob::stopReason, and MemBuf::terminate().
Referenced by BodyPipe::buf(), AsyncJob::callEnd(), AsyncJob::callStart(), ClientRequestContext::clientAccessCheckDone(), ClientRequestContext::clientRedirectDone(), Ftp::Client::ctrlClosed(), Ftp::Relay::dataChannelConnected(), Ftp::Client::dataClosed(), Ftp::Client::dataComplete(), Ftp::Client::doneSendingRequestBody(), Ftp::Client::handleControlReply(), Ftp::Client::handleEpsvReply(), Ftp::Client::handlePasvReply(), Ftp::Client::parseControlReply(), Ftp::Relay::processReplyBody(), Ftp::Gateway::processReplyBody(), Ftp::Relay::readTransferDoneReply(), Ftp::Client::sendEprt(), Ftp::Client::sendPassive(), Adaptation::Initiate::status(), Comm::TcpAcceptor::status(), and AsyncJob::swanSong().
◆ swanSong()
|
protectedvirtualinherited |
Reimplemented from AsyncJob.
Reimplemented in Mgr::Filler.
Definition at line 137 of file StoreToCommWriter.cc.
References Mgr::StoreToCommWriter::close(), debugs, Mgr::StoreToCommWriter::entry, HERE(), NULL, Mgr::StoreToCommWriter::sc, storeUnregister(), StoreEntry::unlock(), and StoreEntry::unregisterAbort().
Referenced by Mgr::Filler::swanSong().
◆ toCbdata()
|
pure virtualinherited |
Implemented in ClientHttpRequest, HttpStateData, and BodySink.
Referenced by AsyncJob::callException(), AsyncJob::callStart(), and CbdataParent::~CbdataParent().
Member Data Documentation
◆ action
|
private |
Definition at line 34 of file ActionWriter.h.
Referenced by ActionWriter(), and start().
◆ buffer
|
protectedinherited |
Definition at line 68 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::scheduleStoreCopy().
◆ clientConnection
|
protectedinherited |
Definition at line 61 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::Abort(), Mgr::StoreToCommWriter::close(), Mgr::StoreToCommWriter::noteCommClosed(), Mgr::StoreToCommWriter::noteCommWrote(), Mgr::StoreToCommWriter::scheduleCommWrite(), Mgr::StoreToCommWriter::start(), and Mgr::StoreToCommWriter::StoreToCommWriter().
◆ closer
|
protectedinherited |
Definition at line 67 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::close(), and Mgr::StoreToCommWriter::StoreToCommWriter().
◆ entry
|
protectedinherited |
Definition at line 63 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::doneAll(), Mgr::StoreToCommWriter::scheduleStoreCopy(), start(), Mgr::Filler::start(), Mgr::StoreToCommWriter::start(), Mgr::StoreToCommWriter::swanSong(), and Mgr::StoreToCommWriter::~StoreToCommWriter().
◆ id
|
protectedinherited |
Definition at line 72 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 71 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), Adaptation::Icap::ModXact::callException(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), Log::TcpLogger::endGracefully(), Log::TcpLogger::handleClosure(), and AsyncJob::mustStop().
◆ sc
|
protectedinherited |
Definition at line 64 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::scheduleStoreCopy(), Mgr::StoreToCommWriter::start(), Mgr::StoreToCommWriter::swanSong(), and Mgr::StoreToCommWriter::~StoreToCommWriter().
◆ stopReason
|
protectedinherited |
Definition at line 69 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and Security::PeerConnector::status().
◆ typeName
|
protectedinherited |
Definition at line 70 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), AsyncJob::callEnd(), Adaptation::Icap::Xaction::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), Adaptation::Icap::Xaction::dieOnConnectionFailure(), Adaptation::Icap::Xaction::disableRepeats(), Adaptation::Icap::Xaction::disableRetries(), Adaptation::Icap::Xaction::handleCommTimedout(), Adaptation::Icap::Xaction::handleSecuredPeer(), AsyncJob::mustStop(), Adaptation::Icap::Xaction::openConnection(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), and Adaptation::Icap::Xaction::~Xaction().
◆ writeOffset
|
protectedinherited |
Definition at line 65 of file StoreToCommWriter.h.
Referenced by Mgr::StoreToCommWriter::doneAll(), Mgr::StoreToCommWriter::noteCommWrote(), and Mgr::StoreToCommWriter::scheduleStoreCopy().
The documentation for this class was generated from the following files:
- src/mgr/ActionWriter.h
- src/mgr/ActionWriter.cc