#include <XactionRep.h>


Public Types | |
typedef libecap::shared_ptr< libecap::adapter::Xaction > | AdapterXaction |
typedef CbcPointer< AsyncJob > | Pointer |
typedef CbcPointer< BodyConsumer > | Pointer |
typedef CbcPointer< BodyProducer > | Pointer |
Public Member Functions | |
XactionRep (Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServicePointer &service) | |
virtual | ~XactionRep () |
void | master (const AdapterXaction &aMaster) |
virtual const libecap::Area | option (const libecap::Name &name) const |
virtual void | visitEachOption (libecap::NamedValueVisitor &visitor) const |
virtual libecap::Message & | virgin () |
virtual const libecap::Message & | cause () |
virtual libecap::Message & | adapted () |
virtual void | useVirgin () |
virtual void | useAdapted (const libecap::shared_ptr< libecap::Message > &msg) |
virtual void | blockVirgin () |
virtual void | adaptationDelayed (const libecap::Delay &) |
virtual void | adaptationAborted () |
virtual void | resume () |
virtual void | vbDiscard () |
virtual void | vbMake () |
virtual void | vbStopMaking () |
virtual void | vbMakeMore () |
virtual libecap::Area | vbContent (libecap::size_type offset, libecap::size_type size) |
virtual void | vbContentShift (libecap::size_type size) |
virtual void | noteAbContentDone (bool atEnd) |
virtual void | noteAbContentAvailable () |
virtual void | noteMoreBodySpaceAvailable (RefCount< BodyPipe > bp) |
virtual void | noteBodyConsumerAborted (RefCount< BodyPipe > bp) |
virtual void | noteMoreBodyDataAvailable (RefCount< BodyPipe > bp) |
virtual void | noteBodyProductionEnded (RefCount< BodyPipe > bp) |
virtual void | noteBodyProducerAborted (RefCount< BodyPipe > bp) |
virtual void | noteInitiatorAborted () |
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... | |
void | initiator (const CbcPointer< Initiator > &i) |
sets initiator 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... | |
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 | |
Service & | service () |
Adaptation::Message & | answer () |
void | sinkVb (const char *reason) |
void | preserveVb (const char *reason) |
void | forgetVb (const char *reason) |
void | moveAbContent () |
void | updateHistory (Http::Message *adapted) |
void | terminateMaster () |
void | scheduleStop (const char *reason) |
void | updateSources (Http::Message *adapted) |
const libecap::Area | clientIpValue () const |
const libecap::Area | usernameValue () const |
const libecap::Area | masterxSharedValue (const libecap::Name &name) const |
const libecap::Area | metaValue (const libecap::Name &name) const |
Return the adaptation meta header value for the given header "name". More... | |
void | visitEachMetaHeader (libecap::NamedValueVisitor &visitor) const |
Return the adaptation meta headers and their values. More... | |
void | doResume () |
void | sendAnswer (const Answer &answer) |
void | tellQueryAborted (bool final) |
void | clearInitiator () |
void | deleteThis (const char *aReason) |
void | mustStop (const char *aReason) |
bool | done () const |
the job is destroyed in callEnd() when done() More... | |
void | stopConsumingFrom (RefCount< BodyPipe > &) |
void | stopProducingFor (RefCount< BodyPipe > &, bool atEof) |
Protected Attributes | |
CbcPointer< Initiator > | theInitiator |
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 Types | |
enum | OperationState { opUndecided, opOn, opComplete, opNever } |
typedef libecap::shared_ptr< libecap::Message > | MessagePtr |
Private Member Functions | |
CBDATA_CLASS (XactionRep) | |
Private Attributes | |
AdapterXaction | theMaster |
Adaptation::ServicePointer | theService |
xaction's adaptation service More... | |
MessageRep | theVirginRep |
MessageRep * | theCauseRep |
MessagePtr | theAnswerRep |
OperationState | makingVb |
OperationState | proxyingAb |
int | adaptHistoryId |
adaptation history slot reservation More... | |
bool | vbProductionFinished |
bool | abProductionFinished |
bool | abProductionAtEnd |
AccessLogEntry::Pointer | al |
Master transaction AccessLogEntry. More... | |
Detailed Description
Definition at line 32 of file XactionRep.h.
Member Typedef Documentation
◆ AdapterXaction
typedef libecap::shared_ptr<libecap::adapter::Xaction> Adaptation::Ecap::XactionRep::AdapterXaction |
Definition at line 41 of file XactionRep.h.
◆ MessagePtr
|
private |
Definition at line 116 of file XactionRep.h.
◆ Pointer [1/3]
|
inherited |
Definition at line 34 of file AsyncJob.h.
◆ Pointer [2/3]
|
inherited |
Definition at line 25 of file BodyPipe.h.
◆ Pointer [3/3]
|
inherited |
Definition at line 45 of file BodyPipe.h.
Member Enumeration Documentation
◆ OperationState
|
private |
Enumerator | |
---|---|
opUndecided | |
opOn | |
opComplete | |
opNever |
Definition at line 119 of file XactionRep.h.
Constructor & Destructor Documentation
◆ XactionRep()
Adaptation::Ecap::XactionRep::XactionRep | ( | Http::Message * | virginHeader, |
HttpRequest * | virginCause, | ||
AccessLogEntry::Pointer & | alp, | ||
const Adaptation::ServicePointer & | service | ||
) |
Definition at line 48 of file XactionRep.cc.
References theCauseRep.
◆ ~XactionRep()
|
virtual |
Definition at line 65 of file XactionRep.cc.
References assert.
Member Function Documentation
◆ adaptationAborted()
|
virtual |
Definition at line 622 of file XactionRep.cc.
◆ adaptationDelayed()
|
virtual |
Definition at line 614 of file XactionRep.cc.
◆ adapted()
|
virtual |
Definition at line 319 of file XactionRep.cc.
References Must.
◆ answer()
|
protected |
Definition at line 326 of file XactionRep.cc.
References Must, and Adaptation::Ecap::MessageRep::raw().
◆ blockVirgin()
|
virtual |
Definition at line 445 of file XactionRep.cc.
References Adaptation::Answer::Block(), debugs, HERE(), Must, and NULL.
◆ 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.
◆ cause()
|
virtual |
Definition at line 312 of file XactionRep.cc.
◆ CBDATA_CLASS()
|
private |
◆ clearInitiator()
|
protectedinherited |
Definition at line 74 of file Initiate.cc.
◆ clientIpValue()
|
protected |
Definition at line 123 of file XactionRep.cc.
References Ip::Address::isAnyAddr(), Ip::Address::isNoAddr(), MAX_IPSTRLEN, Must, request(), Adaptation::Config::send_client_ip, Adaptation::Ecap::TheConfig, Ip::Address::toStr(), and Adaptation::Config::use_indirect_client.
◆ 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()
|
virtual |
Reimplemented from AsyncJob.
Definition at line 344 of file XactionRep.cc.
References AsyncJob::doneAll().
◆ doResume()
|
protected |
the guts of libecap::host::Xaction::resume() API implementation which just goes async in Adaptation::Ecap::XactionRep::resume().
Definition at line 299 of file XactionRep.cc.
References Must.
Referenced by resume().
◆ forgetVb()
|
protected |
Definition at line 382 of file XactionRep.cc.
References debugs, HERE(), NULL, and BodyPipe::stillConsuming().
◆ initiator()
|
inherited |
Definition at line 54 of file Initiate.cc.
References Must, and CbcPointer< Cbc >::valid().
Referenced by Adaptation::Initiator::initiateAdaptation().
◆ master()
void Adaptation::Ecap::XactionRep::master | ( | const AdapterXaction & | aMaster | ) |
Definition at line 73 of file XactionRep.cc.
References Must.
Referenced by Adaptation::Ecap::ServiceRep::makeXactLauncher().
◆ masterxSharedValue()
|
protected |
Definition at line 166 of file XactionRep.cc.
References Adaptation::History::getXxRecord(), Must, NULL, String::rawBuf(), request(), and String::size().
◆ metaValue()
|
protected |
Definition at line 183 of file XactionRep.cc.
References Adaptation::Config::metaHeaders, Must, request(), and SBuf::toStdString().
◆ moveAbContent()
|
protected |
Definition at line 679 of file XactionRep.cc.
◆ 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().
◆ noteAbContentAvailable()
|
virtual |
Definition at line 596 of file XactionRep.cc.
References Must.
◆ noteAbContentDone()
|
virtual |
Definition at line 586 of file XactionRep.cc.
◆ noteBodyConsumerAborted()
◆ noteBodyProducerAborted()
◆ noteBodyProductionEnded()
◆ noteInitiatorAborted()
|
virtual |
Implements Adaptation::Initiate.
Definition at line 672 of file XactionRep.cc.
◆ noteMoreBodyDataAvailable()
◆ noteMoreBodySpaceAvailable()
◆ option()
|
virtual |
Definition at line 88 of file XactionRep.cc.
References Adaptation::Config::masterx_shared_name.
◆ preserveVb()
|
protected |
Definition at line 366 of file XactionRep.cc.
References BodyPipe::consumedSize(), debugs, HERE(), Must, and NULL.
◆ resume()
|
virtual |
Definition at line 287 of file XactionRep.cc.
References asyncCall(), doResume(), and ScheduleCallHere.
◆ scheduleStop()
|
protected |
◆ sendAnswer()
|
protectedinherited |
Definition at line 79 of file Initiate.cc.
References Adaptation::Initiator::noteAdaptationAnswer(), and ScheduleCallHere.
◆ service()
|
protected |
Definition at line 81 of file XactionRep.cc.
◆ sinkVb()
|
protected |
Definition at line 352 of file XactionRep.cc.
References debugs, BodyPipe::enableAutoConsumption(), HERE(), and NULL.
◆ start()
|
virtual |
Reimplemented from AsyncJob.
Definition at line 225 of file XactionRep.cc.
References NotePairs::add(), current_time, NotePairs::hasPair(), Adaptation::Config::metaHeaders, Adaptation::History::metaHeaders, Must, NULL, Adaptation::History::recordXactStart(), and request().
◆ 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()
|
virtual |
for debugging, starts with space
Reimplemented from Adaptation::Initiate.
Definition at line 695 of file XactionRep.cc.
References Adaptation::Message::body_pipe, buf, Must, Adaptation::Ecap::MessageRep::raw(), BodyPipe::stillConsuming(), and BodyPipe::stillProducing().
◆ stopConsumingFrom()
Definition at line 118 of file BodyPipe.cc.
References assert, BodyPipe::clearConsumer(), debugs, and NULL.
Referenced by ClientHttpRequest::~ClientHttpRequest(), Client::cleanAdaptation(), Client::doneSendingRequestBody(), Client::endAdaptedBodyConsumption(), ClientHttpRequest::endRequestSatisfaction(), Client::handleAdaptedBodyProducerAborted(), Client::handleRequestBodyProducerAborted(), BodySink::noteBodyProducerAborted(), ClientHttpRequest::noteBodyProducerAborted(), BodySink::noteBodyProductionEnded(), Client::serverComplete(), and Client::swanSong().
◆ stopProducingFor()
Definition at line 107 of file BodyPipe.cc.
References assert, BodyPipe::clearProducer(), debugs, and NULL.
Referenced by ConnStateData::~ConnStateData(), Client::cleanAdaptation(), ConnStateData::finishDechunkingRequest(), Client::noteBodyConsumerAborted(), and Client::serverComplete2().
◆ swanSong()
|
virtual |
Reimplemented from Adaptation::Initiate.
Definition at line 257 of file XactionRep.cc.
References Must, NULL, Adaptation::History::recordXactFinish(), request(), BodyPipe::stillConsuming(), BodyPipe::stillProducing(), and Adaptation::Initiate::swanSong().
◆ tellQueryAborted()
|
protectedinherited |
Definition at line 87 of file Initiate.cc.
References Adaptation::Answer::Error().
◆ terminateMaster()
|
protected |
Definition at line 334 of file XactionRep.cc.
◆ toCbdata()
|
pure virtualinherited |
Implemented in HttpStateData, ClientHttpRequest, and BodySink.
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
◆ updateHistory()
|
protected |
Called just before sendAnswer() to record adapter meta-information which may affect answer processing and may be needed for logging.
Definition at line 461 of file XactionRep.cc.
References hoReply, Adaptation::Config::masterx_shared_name, Must, NULL, Adaptation::History::recordMeta(), request(), Adaptation::History::updateNextServices(), and Adaptation::History::updateXxRecord().
◆ updateSources()
|
protected |
Definition at line 738 of file XactionRep.cc.
References Must, request(), Http::Message::sources, Http::Message::srcEcap, and Http::Message::srcEcaps.
◆ useAdapted()
|
virtual |
Definition at line 415 of file XactionRep.cc.
References Http::Message::body_pipe, debugs, Adaptation::Answer::Forward(), Http::Message::header, HERE(), Must, NULL, and Adaptation::Ecap::MessageRep::tieBody().
◆ usernameValue()
|
protected |
Definition at line 148 of file XactionRep.cc.
◆ useVirgin()
|
virtual |
Definition at line 397 of file XactionRep.cc.
References Http::Message::body_pipe, debugs, Adaptation::Answer::Forward(), Http::Message::header, HERE(), and Must.
◆ vbContent()
|
virtual |
Definition at line 548 of file XactionRep.cc.
References BodyPipe::buf(), MemBuf::content(), MemBuf::contentSize(), min(), Must, NULL, and size.
◆ vbContentShift()
|
virtual |
Definition at line 572 of file XactionRep.cc.
References BodyPipe::buf(), BodyPipe::consume(), MemBuf::contentSize(), min(), Must, NULL, and size.
◆ vbDiscard()
|
virtual |
Definition at line 510 of file XactionRep.cc.
References Must.
◆ vbMake()
|
virtual |
Definition at line 519 of file XactionRep.cc.
References Must, NULL, and BodyPipe::setConsumerIfNotLate().
◆ vbMakeMore()
|
virtual |
Definition at line 538 of file XactionRep.cc.
References BodyPipe::mayNeedMoreData(), Must, NULL, BodyPipe::productionEnded(), and BodyPipe::stillConsuming().
◆ vbStopMaking()
|
virtual |
Definition at line 529 of file XactionRep.cc.
References Must.
◆ virgin()
|
virtual |
Definition at line 306 of file XactionRep.cc.
◆ visitEachMetaHeader()
|
protected |
Definition at line 207 of file XactionRep.cc.
References Adaptation::Config::metaHeaders, Must, request(), and SBuf::toStdString().
◆ visitEachOption()
|
virtual |
Definition at line 104 of file XactionRep.cc.
References Adaptation::Config::masterx_shared_name.
Member Data Documentation
◆ abProductionAtEnd
|
private |
Definition at line 125 of file XactionRep.h.
◆ abProductionFinished
|
private |
Definition at line 124 of file XactionRep.h.
◆ adaptHistoryId
|
private |
Definition at line 122 of file XactionRep.h.
◆ al
|
private |
Definition at line 126 of file XactionRep.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().
◆ makingVb
|
private |
Definition at line 120 of file XactionRep.h.
◆ proxyingAb
|
private |
Definition at line 121 of file XactionRep.h.
◆ stopReason
|
protectedinherited |
Definition at line 69 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ theAnswerRep
|
private |
Definition at line 117 of file XactionRep.h.
◆ theCauseRep
|
private |
Definition at line 114 of file XactionRep.h.
Referenced by XactionRep().
◆ theInitiator
|
protectedinherited |
Definition at line 51 of file Initiate.h.
◆ theMaster
|
private |
Definition at line 110 of file XactionRep.h.
◆ theService
|
private |
Definition at line 111 of file XactionRep.h.
◆ theVirginRep
|
private |
Definition at line 113 of file XactionRep.h.
◆ 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().
◆ vbProductionFinished
|
private |
Definition at line 123 of file XactionRep.h.
The documentation for this class was generated from the following files:
- src/adaptation/ecap/XactionRep.h
- src/adaptation/ecap/XactionRep.cc