20#if HAVE_LIBECAP_ADAPTER_SERVICE_H
21#include <libecap/adapter/service.h>
23#if HAVE_LIBECAP_COMMON_NAMES_H
24#include <libecap/common/names.h>
26#if HAVE_LIBECAP_COMMON_REGISTRY_H
27#include <libecap/common/registry.h>
41static libecap::shared_ptr<Adaptation::Ecap::Host>
TheHost;
75 return "ecap://squid-cache.org/ecap/hosts/squid";
93 return raw.
substr(0, microPos);
101 if (!vTheir || !*vTheir) {
103 " with libecap prior to v1.0.");
108 const SBuf vSupported(LIBECAP_VERSION);
109 debugs(93, 2, them <<
" with libecap v" << vTheir <<
"; us: v" << vSupported);
115 " with libecap v" << vTheir <<
116 ": incompatible with supported libecap v" << vSupported);
130 Must(!weak.expired());
144 if (lv.application())
147 return 2 + 2*lv.debugging() + 3*lv.operation() + 2*lv.xaction();
154 const int squidSection = 93;
170 static const auto mx = MasterXaction::MakePortless<XactionInitiator::initAdaptationOrphan_>();
184 "Squid executable dynamically linked")) {
186 libecap::RegisterHost(
TheHost);
static int SquidLogLevel(libecap::LogVerbosity lv)
static SBuf EssentialVersion(const SBuf &raw)
Strips libecap version components not affecting compatibility decisions.
static libecap::shared_ptr< Adaptation::Ecap::Host > TheHost
the host application (i.e., Squid) wrapper registered with libecap
static bool SupportedVersion(const char *vTheir, const char *them)
void noteVersionedService(const char *libEcapVersion, const libecap::weak_ptr< libecap::adapter::Service > &s) override
static void Register()
register adaptation host
std::string uri() const override
void describe(std::ostream &os) const override
std::ostream * openDebug(libecap::LogVerbosity lv) override
libecap::shared_ptr< libecap::Message > MessagePtr
MessagePtr newResponse() const override
void closeDebug(std::ostream *debug) override
MessagePtr newRequest() const override
static bool Enabled(const int section, const int level)
whether debugging the given section and the given level produces output
static void Finish()
logs output buffer created in Start() and closes debugging context
static std::ostringstream & Start(const int section, const int level)
opens debugging context and returns output buffer
static const size_type npos
size_type find(char c, size_type startPos=0) const
SBuf substr(size_type pos, size_type n=npos) const
MemBlob::size_type size_type
void debug(const char *format,...)
#define debugs(SECTION, LEVEL, CONTENT)
void RegisterAdapterService(const ServiceRep::AdapterService &adapterService)
register loaded eCAP module service
const libecap::Name protocolIcp
const libecap::Name protocolUnknown
const libecap::Name protocolHtcp
const libecap::Name metaBypassable
an ecap_service parameter
const libecap::Name protocolInternal
const libecap::Name protocolIcy