#include <StoreToCommWriter.h>


Public Types | |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
StoreToCommWriter (const Comm::ConnectionPointer &conn, StoreEntry *anEntry) | |
virtual | ~StoreToCommWriter () |
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 | HandleStoreAbort (StoreToCommWriter *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 (StoreToCommWriter) | |
Detailed Description
manages receive-from-store, write-to-comm, receive-... sequence for the given StoreEntry and client FD
Definition at line 28 of file StoreToCommWriter.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ StoreToCommWriter()
Mgr::StoreToCommWriter::StoreToCommWriter | ( | const Comm::ConnectionPointer & | conn, |
StoreEntry * | anEntry | ||
) |
Definition at line 24 of file StoreToCommWriter.cc.
References asyncCall(), clientConnection, closer, comm_add_close_handler(), debugs, Comm::Connection::fd, HERE(), and noteCommClosed().
◆ ~StoreToCommWriter()
|
virtual |
Member Function Documentation
◆ 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(), and AsyncJob::deleteThis().
◆ callException()
|
virtualinherited |
Reimplemented in ClientHttpRequest, Ftp::Server, Ipc::Inquirer, Ipc::Forwarder, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Adaptation::Icap::ModXact, and ConnStateData.
Definition at line 127 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().
◆ 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.
◆ canBeCalled()
|
inherited |
Definition at line 101 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.
◆ CBDATA_CLASS()
|
private |
◆ close()
|
protected |
closes our copy of the client HTTP connection socket
Definition at line 44 of file StoreToCommWriter.cc.
References comm_remove_close_handler(), Comm::IsConnOpen(), and NULL.
◆ 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.
Referenced by ConnStateData::connStateClosed().
◆ done()
|
protectedinherited |
Definition at line 90 of file AsyncJob.cc.
References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), HappyConnOpener::checkForNewConnection(), and Downloader::downloadFinished().
◆ doneAll()
|
protectedvirtual |
Reimplemented from AsyncJob.
Definition at line 155 of file StoreToCommWriter.cc.
References STORE_OK.
◆ HandleStoreAbort()
|
staticprotected |
Definition at line 163 of file StoreToCommWriter.cc.
References clientConnection, Comm::Connection::close(), and Comm::IsConnOpen().
Referenced by start().
◆ 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(), AsyncJob::callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ noteCommClosed()
|
protected |
Definition at line 131 of file StoreToCommWriter.cc.
References debugs, HERE(), Comm::IsConnOpen(), and Must.
Referenced by StoreToCommWriter().
◆ noteCommWrote()
|
protected |
Definition at line 119 of file StoreToCommWriter.cc.
References debugs, CommCommonCbParams::fd, CommCommonCbParams::flag, HERE(), Must, NULL, Comm::OK, and CommIoCbParams::size.
Referenced by scheduleCommWrite().
◆ noteStoreCopied()
|
protected |
Definition at line 94 of file StoreToCommWriter.cc.
References debugs, StoreIOBuffer::error, StoreIOBuffer::flags, HERE(), StoreIOBuffer::length, and Must.
Referenced by NoteStoreCopied().
◆ NoteStoreCopied()
|
staticprotected |
Definition at line 81 of file StoreToCommWriter.cc.
References asyncCall(), data, Must, noteStoreCopied(), NULL, and ScheduleCallHere.
◆ scheduleCommWrite()
|
protected |
Definition at line 105 of file StoreToCommWriter.cc.
References asyncCall(), StoreIOBuffer::data, debugs, HERE(), Comm::IsConnOpen(), StoreIOBuffer::length, Must, noteCommWrote(), NULL, and Comm::Write().
◆ scheduleStoreCopy()
|
protected |
Definition at line 71 of file StoreToCommWriter.cc.
References debugs, HERE(), Must, NULL, sc, and storeClientCopy().
◆ start()
|
protectedvirtual |
Reimplemented from AsyncJob.
Reimplemented in Mgr::Filler, and Mgr::ActionWriter.
Definition at line 56 of file StoreToCommWriter.cc.
References asyncCall(), cbdataDialer(), debugs, HandleStoreAbort(), HERE(), Comm::IsConnOpen(), Must, NULL, sc, and storeClientListAdd().
Referenced by Mgr::ActionWriter::start(), and Mgr::Filler::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::connectStart(), Adaptation::Icap::Xaction::dnsLookupDone(), Log::TcpLogger::doConnect(), FwdState::establishTunnelThruProxy(), TunnelStateData::establishTunnelThruProxy(), Ipc::Coordinator::handleCacheMgrRequest(), PeerPoolMgr::handleOpenedConnection(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Adaptation::Icap::Xaction::noteCommConnected(), Log::TcpLogger::Open(), HappyConnOpener::openFreshConnection(), PeerPoolMgr::openNewConnection(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), FwdState::secureConnectionToPeer(), TunnelStateData::secureConnectionToPeer(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), CacheManager::start(), Ident::Start(), Adaptation::AccessCheck::Start(), Rock::Rebuild::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 HappyConnOpener, Security::PeerConnector, Ipc::Inquirer, Comm::TcpAcceptor, Http::Tunneler, Adaptation::Initiate, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, and Adaptation::Ecap::XactionRep.
Definition at line 159 of file AsyncJob.cc.
References buf, NULL, and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), Adaptation::Initiate::status(), and Comm::TcpAcceptor::status().
◆ swanSong()
|
protectedvirtual |
Reimplemented from AsyncJob.
Reimplemented in Mgr::Filler.
Definition at line 139 of file StoreToCommWriter.cc.
References debugs, HERE(), NULL, sc, and storeUnregister().
Referenced by Mgr::Filler::swanSong().
◆ toCbdata()
|
pure virtualinherited |
Implemented in HttpStateData, ClientHttpRequest, and BodySink.
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
Member Data Documentation
◆ buffer
|
protected |
Definition at line 68 of file StoreToCommWriter.h.
◆ clientConnection
|
protected |
Definition at line 61 of file StoreToCommWriter.h.
Referenced by StoreToCommWriter(), and HandleStoreAbort().
◆ closer
|
protected |
Definition at line 67 of file StoreToCommWriter.h.
Referenced by StoreToCommWriter().
◆ entry
|
protected |
Definition at line 63 of file StoreToCommWriter.h.
◆ id
|
protectedinherited |
Definition at line 72 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 71 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ sc
|
protected |
Definition at line 64 of file StoreToCommWriter.h.
◆ stopReason
|
protectedinherited |
Definition at line 69 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ typeName
|
protectedinherited |
Definition at line 70 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ writeOffset
|
protected |
Definition at line 65 of file StoreToCommWriter.h.
The documentation for this class was generated from the following files:
- src/mgr/StoreToCommWriter.h
- src/mgr/StoreToCommWriter.cc