Xaction.cc
Go to the documentation of this file.
71Adaptation::Icap::Xaction::Xaction(const char *aTypeName, Adaptation::Icap::ServiceRep::Pointer &aService):
157 const auto &addr = ia ? std::optional<Ip::Address>(ia->current()) : std::optional<Ip::Address>();
158 CallJobHere1(93, 5, CbcPointer<Adaptation::Icap::Xaction>(xa), Adaptation::Icap::Xaction, dnsLookupDone, addr);
180 debugs(93,3, typeName << " opens connection to " << s.cfg().host.termedBuf() << ":" << s.cfg().port);
214 AsyncCall::Pointer callback = JobCallback(93, 3, ConnectDialer, this, Adaptation::Icap::Xaction::noteCommConnected);
215 const auto cs = new Comm::ConnOpener(conn, callback, TheConfig.connect_timeout(service().cfg().bypass));
281 const auto sslConnector = new Ssl::IcapPeerConnector(theService, conn, callback, masterLogEntry(), TheConfig.connect_timeout(service().cfg().bypass));
406 AsyncCall::Pointer call = JobCallback(93, 5, TimeoutDialer, this, Adaptation::Icap::Xaction::noteCommTimedout);
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
Definition: AsyncCall.h:156
#define asyncCallback(dbgSection, dbgLevel, method, object)
Definition: AsyncCallbacks.h:195
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method)
Convenience macro to create a Dialer-based job callback.
Definition: AsyncJobCalls.h:69
#define CallJobHere(debugSection, debugLevel, job, Class, method)
Definition: AsyncJobCalls.h:58
#define CallJobHere1(debugSection, debugLevel, job, Class, method, arg1)
Definition: AsyncJobCalls.h:63
ErrorDetail::Pointer MakeNamedErrorDetail(const char *name)
Definition: Detail.cc:54
void getOutgoingAddress(HttpRequest *request, const Comm::ConnectionPointer &conn)
Definition: FwdState.cc:1476
#define TexcHere(msg)
legacy convenience macro; it is not difficult to type Here() now
Definition: TextException.h:63
static void icapLookupDnsResults(const ipcache_addrs *ia, const Dns::LookupDetails &, void *data)
Definition: Xaction.cc:154
CBDATA_NAMESPACED_CLASS_INIT(Ssl, IcapPeerConnector)
void error(char *format,...)
Definition: FilledChecklist.h:32
Definition: AccessLogEntry.h:41
time_t io_timeout(bool bypassable) const
Definition: Config.cc:49
time_t connect_timeout(bool bypassable) const
Definition: Config.cc:41
Definition: Launcher.h:48
Definition: ServiceRep.h:61
Comm::ConnectionPointer getIdleConnection(bool isRetriable)
Definition: ServiceRep.cc:117
Definition: Launcher.h:83
Definition: Xaction.h:44
void handleSecuredPeer(Security::EncryptorAnswer &answer)
Definition: Xaction.cc:718
void noteCommConnected(const CommConnectCbParams &io)
called when the connection attempt to an ICAP service completes (successfully or not)
Definition: Xaction.cc:255
void noteCommWrote(const CommIoCbParams &io)
Definition: Xaction.cc:331
void callException(const std::exception &e) override
called when the job throws during an async call
Definition: Xaction.cc:374
virtual bool fillVirginHttpHeader(MemBuf &) const
Definition: Xaction.cc:677
bool parseHttpMsg(Http::Message *msg)
Definition: Xaction.cc:498
void useTransportConnection(const Comm::ConnectionPointer &)
Definition: Xaction.cc:270
void useIcapConnection(const Comm::ConnectionPointer &)
react to the availability of a fully-ready ICAP connection
Definition: Xaction.cc:292
void noteCommClosed(const CommCloseCbParams &io)
Definition: Xaction.cc:361
void dieOnConnectionFailure()
Definition: Xaction.cc:308
virtual AccessLogEntry::Pointer masterLogEntry()
Definition: Xaction.cc:105
Xaction(const char *aTypeName, ServiceRep::Pointer &aService)
Definition: Xaction.cc:71
virtual void fillDoneStatus(MemBuf &buf) const
Definition: Xaction.cc:668
void disableRepeats(const char *reason)
Definition: Xaction.cc:125
void dnsLookupDone(std::optional< Ip::Address >)
Definition: Xaction.cc:189
const char * status() const override
internal cleanup; do not call directly
Definition: Xaction.cc:636
void noteCommRead(const CommIoCbParams &io)
Definition: Xaction.cc:428
void noteInitiatorAborted() override
Definition: Xaction.cc:547
virtual void fillPendingStatus(MemBuf &buf) const
Definition: Xaction.cc:650
void setOutcome(const XactOutcome &xo)
Definition: Xaction.cc:561
void noteCommTimedout(const CommTimeoutCbParams &io)
Definition: Xaction.cc:349
Definition: Initiate.h:31
Definition: AsyncJob.h:32
virtual void callException(const std::exception &e)
called when the job throws during an async call
Definition: AsyncJob.cc:143
Definition: CbcPointer.h:26
Definition: CommCalls.h:166
Definition: CommCalls.h:128
Definition: CommCalls.h:105
Definition: CommCalls.h:114
Definition: CommCalls.h:134
Definition: ConnOpener.h:25
Definition: ipcache.h:51
Definition: errorpage.h:89
Definition: HttpRequest.h:49
virtual void reset()=0
bool parse(const char *buf, const size_t sz, bool eol, Http::StatusCode *error)
Definition: Message.cc:68
Definition: MemBuf.h:24
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
Definition: Packable.h:61
Definition: EncryptorAnswer.h:22
bool tunneled
whether we spliced the connections instead of negotiating encryption
Definition: EncryptorAnswer.h:33
Definition: PeerConnector.h:49
virtual bool initialize(Security::SessionPointer &)
Definition: PeerConnector.cc:137
PeerConnector(const Comm::ConnectionPointer &aServerConn, const AsyncCallback< EncryptorAnswer > &, const AccessLogEntryPointer &alp, const time_t timeout=0)
Definition: PeerConnector.cc:38
void fillChecklist(ACLFilledChecklist &) const override
configure the given checklist (to reflect the current transaction state)
Definition: PeerConnector.cc:89
A simple PeerConnector for Secure ICAP services. No SslBump capabilities.
Definition: Xaction.cc:42
Security::ContextPointer getTlsContext() override
Definition: Xaction.cc:57
Adaptation::Icap::ServiceRep::Pointer icapService
Definition: Xaction.cc:65
IcapPeerConnector(Adaptation::Icap::ServiceRep::Pointer &service, const Comm::ConnectionPointer &aServerConn, const AsyncCallback< Security::EncryptorAnswer > &aCallback, AccessLogEntry::Pointer const &alp, const time_t timeout=0)
Definition: Xaction.cc:45
void fillChecklist(ACLFilledChecklist &) const override
configure the given checklist (to reflect the current transaction state)
Definition: Xaction.cc:700
CBDATA_CHILD(IcapPeerConnector)
bool initialize(Security::SessionPointer &) override
Definition: Xaction.cc:683
void noteNegotiationDone(ErrorState *error) override
Definition: Xaction.cc:708
int commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
Definition: comm.cc:595
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:949
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
Definition: comm.cc:978
int commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
Definition: comm.cc:621
int ssl_ex_index_server
void ipcache_nbgethostbyname(const char *name, IPH *handler, void *handlerData)
Definition: ipcache.cc:608
std::ostream & operator<<(std::ostream &os, const XactAbortInfo &xai)
Definition: Launcher.h:105
Definition: AccessCheck.h:25
void ReadCancel(int fd, AsyncCall::Pointer &callback)
Cancel the read pending on FD. No action if none pending.
Definition: Read.cc:219
void Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback)
Definition: Read.cc:40
void Write(const Comm::ConnectionPointer &conn, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func)
Definition: Write.cc:33
Definition: Xaction.cc:139
void SetSessionResumeData(const Security::SessionPointer &, const Security::SessionStatePointer &)
Definition: Session.cc:246
void MaybeGetSessionResumeData(const Security::SessionPointer &, Security::SessionStatePointer &data)
Definition: Session.cc:225
Definition: Xaction.cc:40
void Controller::create() STUB void Controller Controller nil
Definition: stub_libstore.cc:19
void tvSub(struct timeval &res, struct timeval const &t1, struct timeval const &t2)
Definition: gadgets.cc:58
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
Definition: gadgets.cc:17