#include <Xaction.h>

Inheritance diagram for Adaptation::Icap::Xaction:
Collaboration diagram for Adaptation::Icap::Xaction:

Public Types

typedef CbcPointer< AsyncJobPointer

Public Member Functions

 Xaction (const char *aTypeName, ServiceRep::Pointer &aService)
virtual ~Xaction ()
void disableRetries ()
void disableRepeats (const char *reason)
bool retriable () const
bool repeatable () const
void noteCommConnected (const CommConnectCbParams &io)
void noteCommWrote (const CommIoCbParams &io)
void noteCommRead (const CommIoCbParams &io)
void noteCommTimedout (const CommTimeoutCbParams &io)
void noteCommClosed (const CommCloseCbParams &io)
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
virtual void callEnd ()
 called right after the called job method More...
virtual void clearError ()
 clear stored error details, if any; used for retries/repeats More...
virtual AccessLogEntry::Pointer masterLogEntry ()
void dnsLookupDone (const ipcache_addrs *ia)
ServiceRepservice ()
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 * toCbdata ()=0

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...

Public Attributes

 sent (or at least created) ICAP request More...
HttpReply::Pointer icapReply
 received ICAP reply, if any More...
int attempts
 the number of times we tried to get to the service, including this time More...

Protected Member Functions

virtual void start ()
 called by AsyncStart; do not call directly More...
virtual void noteInitiatorAborted ()
virtual void handleCommConnected ()=0
virtual void handleCommWrote (size_t sz)=0
virtual void handleCommRead (size_t sz)=0
virtual void handleCommTimedout ()
virtual void handleCommClosed ()
void handleSecuredPeer (Security::EncryptorAnswer &answer)
virtual void detailError (int)
 record error detail if possible More...
void openConnection ()
void closeConnection ()
void dieOnConnectionFailure ()
bool haveConnection () const
void scheduleRead ()
void scheduleWrite (MemBuf &buf)
void updateTimeout ()
void cancelRead ()
bool parseHttpMsg (Http::Message *msg)
bool mayReadMore () const
virtual bool doneReading () const
virtual bool doneWriting () const
bool doneWithIo () const
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...
virtual void fillPendingStatus (MemBuf &buf) const
virtual void fillDoneStatus (MemBuf &buf) const
virtual bool fillVirginHttpHeader (MemBuf &) const
void setOutcome (const XactOutcome &xo)
virtual void finalizeLogInfo ()
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...

Protected Attributes

Comm::ConnectionPointer connection
 ICAP server connection. More...
Adaptation::Icap::ServiceRep::Pointer theService
SBuf readBuf
bool commEof
bool reuseConnection
bool isRetriable
 can retry on persistent connection failures More...
bool isRepeatable
 can repeat if no or unsatisfactory response More...
bool ignoreLastWrite
const char * stopReason
AsyncCall::Pointer connector
AsyncCall::Pointer reader
AsyncCall::Pointer writer
AsyncCall::Pointer closer
AccessLogEntry::Pointer alep
 icap.log entry More...
 short for *alep More...
timeval icap_tr_start
timeval icap_tio_start
timeval icap_tio_finish
CbcPointer< InitiatortheInitiator
const char * typeName
 kid (leaf) class name, for debugging More...
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
const InstanceId< AsyncJobid
 job identifier More...

Private Member Functions

void tellQueryAborted ()
void maybeLog ()

Private Attributes

Comm::ConnOpener::Pointer cs
AsyncCall::Pointer securer
 whether we are securing a connection More...

Detailed Description

Definition at line 37 of file Xaction.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ Xaction()

Adaptation::Icap::Xaction::Xaction ( const char *  aTypeName,
ServiceRep::Pointer aService 

◆ ~Xaction()

Adaptation::Icap::Xaction::~Xaction ( )

Definition at line 108 of file Xaction.cc.

References debugs, HTTPMSGUNLOCK(), icapRequest, and AsyncJob::typeName.

Member Function Documentation

◆ callEnd()

void Adaptation::Icap::Xaction::callEnd ( )

called right after the called job method

Reimplemented from AsyncJob.

Definition at line 408 of file Xaction.cc.

References AsyncJob::callEnd(), closeConnection(), debugs, doneWithIo(), HERE(), status(), and AsyncJob::typeName.

Referenced by detailError().

◆ callException()

void Adaptation::Icap::Xaction::callException ( const std::exception &  e)

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Referenced by AsyncJob::swanSong().

◆ cancelRead()

void Adaptation::Icap::Xaction::cancelRead ( )

◆ clearError()

virtual void Adaptation::Icap::Xaction::clearError ( )

◆ clearInitiator()

◆ closeConnection()

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)

◆ detailError()

◆ dieOnConnectionFailure()

void Adaptation::Icap::Xaction::dieOnConnectionFailure ( )

◆ disableRepeats()

◆ disableRetries()

◆ dnsLookupDone()

◆ done()

◆ doneAll()

bool Adaptation::Icap::Xaction::doneAll ( ) const

Reimplemented from AsyncJob.

Reimplemented in Adaptation::Icap::ModXact.

Definition at line 417 of file Xaction.cc.

References connector, AsyncJob::doneAll(), reader, securer, and writer.

Referenced by detailError(), and Adaptation::Icap::ModXact::doneAll().

◆ doneReading()

bool Adaptation::Icap::Xaction::doneReading ( ) const

Reimplemented in Adaptation::Icap::ModXact, and Adaptation::Icap::OptXact.

Definition at line 549 of file Xaction.cc.

References commEof.

Referenced by detailError(), doneWithIo(), and mayReadMore().

◆ doneWithIo()

bool Adaptation::Icap::Xaction::doneWithIo ( ) const

◆ doneWriting()

bool Adaptation::Icap::Xaction::doneWriting ( ) const

Reimplemented in Adaptation::Icap::ModXact.

Definition at line 554 of file Xaction.cc.

References writer.

Referenced by detailError(), and doneWithIo().

◆ fillDoneStatus()

void Adaptation::Icap::Xaction::fillDoneStatus ( MemBuf buf) const

◆ fillPendingStatus()

void Adaptation::Icap::Xaction::fillPendingStatus ( MemBuf buf) const

◆ fillVirginHttpHeader()

bool Adaptation::Icap::Xaction::fillVirginHttpHeader ( MemBuf ) const

Reimplemented in Adaptation::Icap::ModXact.

Definition at line 701 of file Xaction.cc.

Referenced by detailError().

◆ finalizeLogInfo()

◆ handleCommClosed()

void Adaptation::Icap::Xaction::handleCommClosed ( )

Definition at line 395 of file Xaction.cc.

References detailError(), ERR_DETAIL_ICAP_XACT_CLOSE, and AsyncJob::mustStop().

Referenced by noteCommClosed().

◆ handleCommConnected()

virtual void Adaptation::Icap::Xaction::handleCommConnected ( )
protectedpure virtual

◆ handleCommRead()

virtual void Adaptation::Icap::Xaction::handleCommRead ( size_t  sz)
protectedpure virtual

◆ handleCommTimedout()

void Adaptation::Icap::Xaction::handleCommTimedout ( )

◆ handleCommWrote()

virtual void Adaptation::Icap::Xaction::handleCommWrote ( size_t  sz)
protectedpure virtual

◆ handleSecuredPeer()

◆ haveConnection()

◆ initiator()

void Adaptation::Initiate::initiator ( const CbcPointer< Initiator > &  i)

◆ masterLogEntry()

AccessLogEntry::Pointer Adaptation::Icap::Xaction::masterLogEntry ( )

Reimplemented in Adaptation::Icap::ModXact.

Definition at line 116 of file Xaction.cc.

References Store::nil.

Referenced by clearError(), and noteCommConnected().

◆ maybeLog()

void Adaptation::Icap::Xaction::maybeLog ( )

Definition at line 632 of file Xaction.cc.

References alep, finalizeLogInfo(), IcapLogfileStatus, icapLogLog(), and LOG_ENABLE.

Referenced by clearError(), and swanSong().

◆ mayReadMore()

bool Adaptation::Icap::Xaction::mayReadMore ( ) const

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)

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(), handleCommClosed(), Http::Tunneler::handleConnectionClosure(), 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(), noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), 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()

void Adaptation::Icap::Xaction::noteCommClosed ( const CommCloseCbParams io)

Definition at line 385 of file Xaction.cc.

References AsyncCall::cancel(), closer, handleCommClosed(), NULL, and securer.

Referenced by noteCommConnected(), and repeatable().

◆ noteCommConnected()

◆ noteCommRead()

◆ noteCommTimedout()

void Adaptation::Icap::Xaction::noteCommTimedout ( const CommTimeoutCbParams io)

Definition at line 362 of file Xaction.cc.

References handleCommTimedout().

Referenced by noteCommConnected(), repeatable(), and updateTimeout().

◆ noteCommWrote()

◆ noteInitiatorAborted()

◆ openConnection()

◆ parseHttpMsg()

◆ repeatable()

bool Adaptation::Icap::Xaction::repeatable ( ) const

◆ retriable()

bool Adaptation::Icap::Xaction::retriable ( ) const

Definition at line 46 of file Xaction.h.

References isRetriable.

Referenced by noteCommRead(), and tellQueryAborted().

◆ scheduleRead()

◆ scheduleWrite()

◆ sendAnswer()

◆ service()

◆ setOutcome()

◆ Start()

◆ start()

void Adaptation::Icap::Xaction::start ( )

Reimplemented from AsyncJob.

Reimplemented in Adaptation::Icap::ModXact, and Adaptation::Icap::OptXact.

Definition at line 143 of file Xaction.cc.

References AsyncJob::start().

Referenced by Adaptation::Icap::OptXact::start(), and Adaptation::Icap::ModXact::start().

◆ status()

◆ swanSong()

◆ tellQueryAborted() [1/2]

◆ tellQueryAborted() [2/2]

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

◆ updateTimeout()

Member Data Documentation

◆ al

◆ alep

AccessLogEntry::Pointer Adaptation::Icap::Xaction::alep

Definition at line 148 of file Xaction.h.

Referenced by Adaptation::Icap::ModXact::finalizeLogInfo(), and maybeLog().

◆ attempts

int Adaptation::Icap::Xaction::attempts

◆ closer

AsyncCall::Pointer Adaptation::Icap::Xaction::closer

Definition at line 146 of file Xaction.h.

Referenced by closeConnection(), handleSecuredPeer(), noteCommClosed(), and noteCommConnected().

◆ commEof

bool Adaptation::Icap::Xaction::commEof

◆ connection

◆ connector

AsyncCall::Pointer Adaptation::Icap::Xaction::connector

◆ cs

Comm::ConnOpener::Pointer Adaptation::Icap::Xaction::cs

Definition at line 156 of file Xaction.h.

Referenced by dnsLookupDone(), noteCommConnected(), and swanSong().

◆ icap_tio_finish

timeval Adaptation::Icap::Xaction::icap_tio_finish

◆ icap_tio_start

timeval Adaptation::Icap::Xaction::icap_tio_start

◆ icap_tr_start

timeval Adaptation::Icap::Xaction::icap_tr_start

Definition at line 151 of file Xaction.h.

Referenced by finalizeLogInfo(), Adaptation::Icap::ModXact::start(), and Xaction().

◆ icapReply

◆ icapRequest

◆ id

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 72 of file AsyncJob.h.

◆ ignoreLastWrite

bool Adaptation::Icap::Xaction::ignoreLastWrite

Definition at line 138 of file Xaction.h.

Referenced by noteCommWrote(), and Adaptation::Icap::ModXact::stopWriting().

◆ inCall

◆ isRepeatable

bool Adaptation::Icap::Xaction::isRepeatable

Definition at line 137 of file Xaction.h.

Referenced by disableRepeats(), repeatable(), and Adaptation::Icap::ModXact::virginConsume().

◆ isRetriable

◆ readBuf

◆ reader

◆ reuseConnection

◆ securer

AsyncCall::Pointer Adaptation::Icap::Xaction::securer

Definition at line 157 of file Xaction.h.

Referenced by doneAll(), handleSecuredPeer(), noteCommClosed(), and noteCommConnected().

◆ stopReason

const char* Adaptation::Icap::Xaction::stopReason

Definition at line 140 of file Xaction.h.

Referenced by fillDoneStatus().

◆ theInitiator

◆ theService

Adaptation::Icap::ServiceRep::Pointer Adaptation::Icap::Xaction::theService

Definition at line 131 of file Xaction.h.

Referenced by handleCommTimedout(), noteCommConnected(), and service().

◆ typeName

◆ writer

The documentation for this class was generated from the following files:






Web Site Translations