structure and Icap namespace placement.
#include "adaptation/ecap/ServiceRep.h"
#include "adaptation/ecap/Config.h"
-Ecap::Config Ecap::TheConfig;
+Adaptation::Ecap::Config Adaptation::Ecap::TheConfig;
-Ecap::Config::Config()
+Adaptation::Ecap::Config::Config()
{
}
-Ecap::Config::~Config()
+Adaptation::Ecap::Config::~Config()
{
}
void
-Ecap::Config::finalize()
+Adaptation::Ecap::Config::finalize()
{
Adaptation::Config::finalize();
- libecap::shared_ptr<Ecap::Host> host(new Ecap::Host);
+ libecap::shared_ptr<Adaptation::Ecap::Host> host(new Adaptation::Ecap::Host);
libecap::RegisterHost(host);
}
Adaptation::ServicePointer
-Ecap::Config::createService(const Adaptation::ServiceConfig &cfg)
+Adaptation::Ecap::Config::createService(const Adaptation::ServiceConfig &cfg)
{
- Adaptation::ServicePointer s = new Ecap::ServiceRep(cfg);
+ Adaptation::ServicePointer s = new Adaptation::Ecap::ServiceRep(cfg);
return s.getRaw();
}
#include "adaptation/Config.h"
-namespace Ecap
-{
+namespace Adaptation {
+namespace Ecap {
class Config: public Adaptation::Config
{
extern Config TheConfig;
} // namespace Ecap
+} // namespace Adaptation
#endif /* SQUID_ECAP_CONFIG_H */
#include "adaptation/ecap/ServiceRep.h"
#include "adaptation/ecap/Host.h"
-const libecap::Name Ecap::protocolInternal("internal", libecap::Name::NextId());
-const libecap::Name Ecap::protocolCacheObj("cache_object", libecap::Name::NextId());
-const libecap::Name Ecap::protocolIcp("ICP", libecap::Name::NextId());
+const libecap::Name Adaptation::Ecap::protocolInternal("internal", libecap::Name::NextId());
+const libecap::Name Adaptation::Ecap::protocolCacheObj("cache_object", libecap::Name::NextId());
+const libecap::Name Adaptation::Ecap::protocolIcp("ICP", libecap::Name::NextId());
#if USE_HTCP
-const libecap::Name Ecap::protocolHtcp("Htcp", libecap::Name::NextId());
+const libecap::Name Adaptation::Ecap::protocolHtcp("Htcp", libecap::Name::NextId());
#endif
-Ecap::Host::Host()
+Adaptation::Ecap::Host::Host()
{
// assign our host-specific IDs to well-known names
libecap::headerReferer.assignHostId(HDR_REFERER);
}
std::string
-Ecap::Host::uri() const
+Adaptation::Ecap::Host::uri() const
{
return "ecap://squid-cache.org/ecap/hosts/squid";
}
void
-Ecap::Host::describe(std::ostream &os) const
+Adaptation::Ecap::Host::describe(std::ostream &os) const
{
os << PACKAGE_NAME << " v" << PACKAGE_VERSION;
}
void
-Ecap::Host::noteService(const libecap::weak_ptr<libecap::adapter::Service> &weak)
+Adaptation::Ecap::Host::noteService(const libecap::weak_ptr<libecap::adapter::Service> &weak)
{
// Many ecap_service lines may use the same service URI. Find each
// matching service rep, make sure it is an eCAP rep,
}
std::ostream *
-Ecap::Host::openDebug(libecap::LogVerbosity lv)
+Adaptation::Ecap::Host::openDebug(libecap::LogVerbosity lv)
{
const int squidLevel = SquidLogLevel(lv);
const int squidSection = 93; // XXX: this should be a global constant
}
void
-Ecap::Host::closeDebug(std::ostream *debug)
+Adaptation::Ecap::Host::closeDebug(std::ostream *debug)
{
if (debug)
Debug::finishDebug();
#include <libecap/host/host.h>
-namespace Ecap
-{
+namespace Adaptation {
+namespace Ecap {
// Squid wrapper, providing host application functionality to eCAP services.
class Host : public libecap::host::Host
#endif
} // namespace Ecap
+} // namespace Adaptation
#endif /* SQUID_ECAP_HOST_H */
/* HeaderRep */
-Ecap::HeaderRep::HeaderRep(HttpMsg &aMessage): theHeader(aMessage.header),
+Adaptation::Ecap::HeaderRep::HeaderRep(HttpMsg &aMessage): theHeader(aMessage.header),
theMessage(aMessage)
{
}
bool
-Ecap::HeaderRep::hasAny(const Name &name) const
+Adaptation::Ecap::HeaderRep::hasAny(const Name &name) const
{
const http_hdr_type squidId = TranslateHeaderId(name);
// XXX: optimize to remove getByName: we do not need the value here
(bool)theHeader.has(squidId);
}
-Ecap::HeaderRep::Value
-Ecap::HeaderRep::value(const Name &name) const
+Adaptation::Ecap::HeaderRep::Value
+Adaptation::Ecap::HeaderRep::value(const Name &name) const
{
const http_hdr_type squidId = TranslateHeaderId(name);
const String value = squidId == HDR_OTHER ?
}
void
-Ecap::HeaderRep::add(const Name &name, const Value &value)
+Adaptation::Ecap::HeaderRep::add(const Name &name, const Value &value)
{
const http_hdr_type squidId = TranslateHeaderId(name); // HDR_OTHER OK
HttpHeaderEntry *e = new HttpHeaderEntry(squidId, name.image().c_str(),
}
void
-Ecap::HeaderRep::removeAny(const Name &name)
+Adaptation::Ecap::HeaderRep::removeAny(const Name &name)
{
const http_hdr_type squidId = TranslateHeaderId(name);
if (squidId == HDR_OTHER)
}
libecap::Area
-Ecap::HeaderRep::image() const
+Adaptation::Ecap::HeaderRep::image() const
{
MemBuf mb;
mb.init();
// throws on failures
void
-Ecap::HeaderRep::parse(const Area &buf)
+Adaptation::Ecap::HeaderRep::parse(const Area &buf)
{
MemBuf mb;
mb.init();
}
http_hdr_type
-Ecap::HeaderRep::TranslateHeaderId(const Name &name)
+Adaptation::Ecap::HeaderRep::TranslateHeaderId(const Name &name)
{
if (name.assignedHostId())
return static_cast<http_hdr_type>(name.hostId());
/* FirstLineRep */
-Ecap::FirstLineRep::FirstLineRep(HttpMsg &aMessage): theMessage(aMessage)
+Adaptation::Ecap::FirstLineRep::FirstLineRep(HttpMsg &aMessage): theMessage(aMessage)
{
}
libecap::Version
-Ecap::FirstLineRep::version() const
+Adaptation::Ecap::FirstLineRep::version() const
{
return libecap::Version(theMessage.http_ver.major,
theMessage.http_ver.minor);
}
void
-Ecap::FirstLineRep::version(const libecap::Version &aVersion)
+Adaptation::Ecap::FirstLineRep::version(const libecap::Version &aVersion)
{
theMessage.http_ver.major = aVersion.majr;
theMessage.http_ver.minor = aVersion.minr;
}
libecap::Name
-Ecap::FirstLineRep::protocol() const
+Adaptation::Ecap::FirstLineRep::protocol() const
{
// TODO: optimize?
switch (theMessage.protocol) {
}
void
-Ecap::FirstLineRep::protocol(const Name &p)
+Adaptation::Ecap::FirstLineRep::protocol(const Name &p)
{
// TODO: what happens if we fail to translate some protocol?
theMessage.protocol = TranslateProtocolId(p);
}
protocol_t
-Ecap::FirstLineRep::TranslateProtocolId(const Name &name)
+Adaptation::Ecap::FirstLineRep::TranslateProtocolId(const Name &name)
{
if (name.assignedHostId())
return static_cast<protocol_t>(name.hostId());
/* RequestHeaderRep */
-Ecap::RequestLineRep::RequestLineRep(HttpRequest &aMessage):
+Adaptation::Ecap::RequestLineRep::RequestLineRep(HttpRequest &aMessage):
FirstLineRep(aMessage), theMessage(aMessage)
{
}
void
-Ecap::RequestLineRep::uri(const Area &aUri)
+Adaptation::Ecap::RequestLineRep::uri(const Area &aUri)
{
// TODO: if method is not set, urlPath will assume it is not connect;
// Can we change urlParse API to remove the method parameter?
Must(ok);
}
-Ecap::RequestLineRep::Area
-Ecap::RequestLineRep::uri() const
+Adaptation::Ecap::RequestLineRep::Area
+Adaptation::Ecap::RequestLineRep::uri() const
{
return Area::FromTempBuffer(theMessage.urlpath.rawBuf(),
theMessage.urlpath.size());
}
void
-Ecap::RequestLineRep::method(const Name &aMethod)
+Adaptation::Ecap::RequestLineRep::method(const Name &aMethod)
{
if (aMethod.assignedHostId()) {
const int id = aMethod.hostId();
}
}
-Ecap::RequestLineRep::Name
-Ecap::RequestLineRep::method() const
+Adaptation::Ecap::RequestLineRep::Name
+Adaptation::Ecap::RequestLineRep::method() const
{
switch (theMessage.method.id()) {
case METHOD_GET:
}
libecap::Version
-Ecap::RequestLineRep::version() const
+Adaptation::Ecap::RequestLineRep::version() const
{
return FirstLineRep::version();
}
void
-Ecap::RequestLineRep::version(const libecap::Version &aVersion)
+Adaptation::Ecap::RequestLineRep::version(const libecap::Version &aVersion)
{
FirstLineRep::version(aVersion);
}
libecap::Name
-Ecap::RequestLineRep::protocol() const
+Adaptation::Ecap::RequestLineRep::protocol() const
{
return FirstLineRep::protocol();
}
void
-Ecap::RequestLineRep::protocol(const Name &p)
+Adaptation::Ecap::RequestLineRep::protocol(const Name &p)
{
FirstLineRep::protocol(p);
}
/* ReplyHeaderRep */
-Ecap::StatusLineRep::StatusLineRep(HttpReply &aMessage):
+Adaptation::Ecap::StatusLineRep::StatusLineRep(HttpReply &aMessage):
FirstLineRep(aMessage), theMessage(aMessage)
{
}
void
-Ecap::StatusLineRep::statusCode(int code)
+Adaptation::Ecap::StatusLineRep::statusCode(int code)
{
// TODO: why is .status a enum? Do we not support unknown statuses?
theMessage.sline.status = static_cast<http_status>(code);
}
int
-Ecap::StatusLineRep::statusCode() const
+Adaptation::Ecap::StatusLineRep::statusCode() const
{
// TODO: see statusCode(code) TODO above
return static_cast<int>(theMessage.sline.status);
}
void
-Ecap::StatusLineRep::reasonPhrase(const Area &)
+Adaptation::Ecap::StatusLineRep::reasonPhrase(const Area &)
{
// Squid does not support custom reason phrases
theMessage.sline.reason = NULL;
}
-Ecap::StatusLineRep::Area
-Ecap::StatusLineRep::reasonPhrase() const
+Adaptation::Ecap::StatusLineRep::Area
+Adaptation::Ecap::StatusLineRep::reasonPhrase() const
{
return theMessage.sline.reason ?
Area::FromTempString(std::string(theMessage.sline.reason)) : Area();
}
libecap::Version
-Ecap::StatusLineRep::version() const
+Adaptation::Ecap::StatusLineRep::version() const
{
return FirstLineRep::version();
}
void
-Ecap::StatusLineRep::version(const libecap::Version &aVersion)
+Adaptation::Ecap::StatusLineRep::version(const libecap::Version &aVersion)
{
FirstLineRep::version(aVersion);
}
libecap::Name
-Ecap::StatusLineRep::protocol() const
+Adaptation::Ecap::StatusLineRep::protocol() const
{
return FirstLineRep::protocol();
}
void
-Ecap::StatusLineRep::protocol(const Name &p)
+Adaptation::Ecap::StatusLineRep::protocol(const Name &p)
{
FirstLineRep::protocol(p);
}
/* BodyRep */
-Ecap::BodyRep::BodyRep(const BodyPipe::Pointer &aBody): theBody(aBody)
+Adaptation::Ecap::BodyRep::BodyRep(const BodyPipe::Pointer &aBody): theBody(aBody)
{
}
void
-Ecap::BodyRep::tie(const BodyPipe::Pointer &aBody)
+Adaptation::Ecap::BodyRep::tie(const BodyPipe::Pointer &aBody)
{
Must(!theBody);
Must(aBody != NULL);
theBody = aBody;
}
-Ecap::BodyRep::BodySize
-Ecap::BodyRep::bodySize() const
+Adaptation::Ecap::BodyRep::BodySize
+Adaptation::Ecap::BodyRep::bodySize() const
{
return !theBody ? BodySize() : BodySize(theBody->bodySize());
}
/* MessageRep */
-Ecap::MessageRep::MessageRep(HttpMsg *rawHeader):
+Adaptation::Ecap::MessageRep::MessageRep(HttpMsg *rawHeader):
theMessage(rawHeader), theFirstLineRep(NULL),
theHeaderRep(NULL), theBodyRep(NULL)
{
theBodyRep = new BodyRep(theMessage.body_pipe);
}
-Ecap::MessageRep::~MessageRep()
+Adaptation::Ecap::MessageRep::~MessageRep()
{
delete theBodyRep;
delete theHeaderRep;
}
libecap::shared_ptr<libecap::Message>
-Ecap::MessageRep::clone() const
+Adaptation::Ecap::MessageRep::clone() const
{
HttpMsg *hdr = theMessage.header->clone();
hdr->body_pipe = NULL; // if any; TODO: remove pipe cloning from ::clone?
}
libecap::FirstLine &
-Ecap::MessageRep::firstLine()
+Adaptation::Ecap::MessageRep::firstLine()
{
return *theFirstLineRep;
}
const libecap::FirstLine &
-Ecap::MessageRep::firstLine() const
+Adaptation::Ecap::MessageRep::firstLine() const
{
return *theFirstLineRep;
}
libecap::Header &
-Ecap::MessageRep::header()
+Adaptation::Ecap::MessageRep::header()
{
return *theHeaderRep;
}
const libecap::Header &
-Ecap::MessageRep::header() const
+Adaptation::Ecap::MessageRep::header() const
{
return *theHeaderRep;
}
libecap::Body *
-Ecap::MessageRep::body()
+Adaptation::Ecap::MessageRep::body()
{
return theBodyRep;
}
void
-Ecap::MessageRep::addBody()
+Adaptation::Ecap::MessageRep::addBody()
{
Must(!theBodyRep);
Must(!theMessage.body_pipe); // set in tieBody()
}
void
-Ecap::MessageRep::tieBody(Ecap::XactionRep *x)
+Adaptation::Ecap::MessageRep::tieBody(Adaptation::Ecap::XactionRep *x)
{
Must(theBodyRep != NULL); // addBody must be called first
Must(!theMessage.header->body_pipe);
theBodyRep->tie(theMessage.body_pipe);
}
-const libecap::Body *Ecap::MessageRep::body() const
+const libecap::Body *Adaptation::Ecap::MessageRep::body() const
{
return theBodyRep;
}
class HttpRequest;
class HttpReply;
-namespace Ecap
-{
+namespace Adaptation {
+namespace Ecap {
class XactionRep;
BodyRep *theBodyRep; // body wrapper
};
-} // namespace Ecap;
+} // namespace Ecap
+} // namespace Adaptation
#endif /* SQUID__E_CAP__MESSAGE_REP_H */
#include "adaptation/ecap/ServiceRep.h"
#include "adaptation/ecap/XactionRep.h"
-Ecap::ServiceRep::ServiceRep(const Adaptation::ServiceConfig &cfg):
- /*AsyncJob("Ecap::ServiceRep"),*/ Adaptation::Service(cfg)
+Adaptation::Ecap::ServiceRep::ServiceRep(const Adaptation::ServiceConfig &cfg):
+ /*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg)
{
}
-Ecap::ServiceRep::~ServiceRep()
+Adaptation::Ecap::ServiceRep::~ServiceRep()
{
}
-void Ecap::ServiceRep::noteService(const AdapterService &s)
+void Adaptation::Ecap::ServiceRep::noteService(const AdapterService &s)
{
Must(s != NULL);
theService = s;
s->uri() << ' ' << cfg().key << "\n");
}
-void Ecap::ServiceRep::invalidate()
+void Adaptation::Ecap::ServiceRep::invalidate()
{
theService->retire();
theService.reset();
}
-void Ecap::ServiceRep::noteFailure()
+void Adaptation::Ecap::ServiceRep::noteFailure()
{
assert(false); // XXX: should this be ICAP-specific?
}
void
-Ecap::ServiceRep::finalize()
+Adaptation::Ecap::ServiceRep::finalize()
{
Adaptation::Service::finalize();
if (!theService) {
}
}
-bool Ecap::ServiceRep::probed() const
+bool Adaptation::Ecap::ServiceRep::probed() const
{
return true; // we "probe" the adapter in finalize().
}
-bool Ecap::ServiceRep::up() const
+bool Adaptation::Ecap::ServiceRep::up() const
{
return theService != NULL;
}
-bool Ecap::ServiceRep::wantsUrl(const String &urlPath) const
+bool Adaptation::Ecap::ServiceRep::wantsUrl(const String &urlPath) const
{
Must(up());
return theService->wantsUrl(urlPath.termedBuf());
}
Adaptation::Initiate *
-Ecap::ServiceRep::makeXactLauncher(Adaptation::Initiator *initiator,
+Adaptation::Ecap::ServiceRep::makeXactLauncher(Adaptation::Initiator *initiator,
HttpMsg *virgin, HttpRequest *cause)
{
Must(up());
}
// returns a temporary string depicting service status, for debugging
-const char *Ecap::ServiceRep::status() const
+const char *Adaptation::Ecap::ServiceRep::status() const
{
assert(false); // move generic stuff from ICAP to Adaptation
// add theService->status()?
#include <libecap/common/forward.h>
#include <libecap/common/memory.h>
-namespace Ecap
-{
+namespace Adaptation {
+namespace Ecap {
/* The eCAP service representative maintains information about a single eCAP
service that Squid communicates with. One eCAP module may register many
};
} // namespace Ecap
+} // namespace Adaptation
#endif /* SQUID_ECAP_SERVICE_REP_H */
#include "HttpReply.h"
#include "adaptation/ecap/XactionRep.h"
-CBDATA_NAMESPACED_CLASS_INIT(Ecap::XactionRep, XactionRep);
+CBDATA_NAMESPACED_CLASS_INIT(Adaptation::Ecap::XactionRep, XactionRep);
-Ecap::XactionRep::XactionRep(Adaptation::Initiator *anInitiator,
+Adaptation::Ecap::XactionRep::XactionRep(Adaptation::Initiator *anInitiator,
HttpMsg *virginHeader, HttpRequest *virginCause,
const Adaptation::ServicePointer &aService):
- AsyncJob("Ecap::XactionRep"),
- Adaptation::Initiate("Ecap::XactionRep", anInitiator, aService),
+ AsyncJob("Adaptation::Ecap::XactionRep"),
+ Adaptation::Initiate("Adaptation::Ecap::XactionRep", anInitiator, aService),
theVirginRep(virginHeader), theCauseRep(NULL),
proxyingVb(opUndecided), proxyingAb(opUndecided), canAccessVb(false)
{
theCauseRep = new MessageRep(virginCause);
}
-Ecap::XactionRep::~XactionRep()
+Adaptation::Ecap::XactionRep::~XactionRep()
{
assert(!theMaster);
delete theCauseRep;
}
void
-Ecap::XactionRep::master(const AdapterXaction &x)
+Adaptation::Ecap::XactionRep::master(const AdapterXaction &x)
{
Must(!theMaster);
Must(x != NULL);
}
void
-Ecap::XactionRep::start()
+Adaptation::Ecap::XactionRep::start()
{
Must(theMaster);
}
void
-Ecap::XactionRep::swanSong()
+Adaptation::Ecap::XactionRep::swanSong()
{
// clear body_pipes, if any
// this code does not maintain proxying* and canAccessVb states; should it?
}
libecap::Message &
-Ecap::XactionRep::virgin()
+Adaptation::Ecap::XactionRep::virgin()
{
return theVirginRep;
}
const libecap::Message &
-Ecap::XactionRep::cause()
+Adaptation::Ecap::XactionRep::cause()
{
Must(theCauseRep != NULL);
return *theCauseRep;
}
libecap::Message &
-Ecap::XactionRep::adapted()
+Adaptation::Ecap::XactionRep::adapted()
{
Must(theAnswerRep != NULL);
return *theAnswerRep;
}
Adaptation::Message &
-Ecap::XactionRep::answer()
+Adaptation::Ecap::XactionRep::answer()
{
MessageRep *rep = dynamic_cast<MessageRep*>(theAnswerRep.get());
Must(rep);
}
void
-Ecap::XactionRep::terminateMaster()
+Adaptation::Ecap::XactionRep::terminateMaster()
{
if (theMaster) {
AdapterXaction x = theMaster;
}
bool
-Ecap::XactionRep::doneAll() const
+Adaptation::Ecap::XactionRep::doneAll() const
{
return proxyingVb >= opComplete && proxyingAb >= opComplete &&
Adaptation::Initiate::doneAll();
// stops receiving virgin and enables auto-consumption
void
-Ecap::XactionRep::dropVirgin(const char *reason)
+Adaptation::Ecap::XactionRep::dropVirgin(const char *reason)
{
debugs(93,4, HERE << "because " << reason << "; status:" << status());
Must(proxyingVb = opOn);
}
void
-Ecap::XactionRep::useVirgin()
+Adaptation::Ecap::XactionRep::useVirgin()
{
debugs(93,3, HERE << status());
Must(proxyingAb == opUndecided);
}
void
-Ecap::XactionRep::useAdapted(const libecap::shared_ptr<libecap::Message> &m)
+Adaptation::Ecap::XactionRep::useAdapted(const libecap::shared_ptr<libecap::Message> &m)
{
debugs(93,3, HERE << status());
Must(m);
}
void
-Ecap::XactionRep::vbDiscard()
+Adaptation::Ecap::XactionRep::vbDiscard()
{
Must(proxyingVb == opUndecided);
// if adapter does not need vb, we do not need to send it
}
void
-Ecap::XactionRep::vbMake()
+Adaptation::Ecap::XactionRep::vbMake()
{
Must(proxyingVb == opUndecided);
BodyPipePointer &p = theVirginRep.raw().body_pipe;
}
void
-Ecap::XactionRep::vbStopMaking()
+Adaptation::Ecap::XactionRep::vbStopMaking()
{
// if adapter does not need vb, we do not need to receive it
if (proxyingVb == opOn)
}
void
-Ecap::XactionRep::vbMakeMore()
+Adaptation::Ecap::XactionRep::vbMakeMore()
{
Must(proxyingVb == opOn); // cannot make more if done proxying
// we cannot guarantee more vb, but we can check that there is a chance
}
libecap::Area
-Ecap::XactionRep::vbContent(libecap::size_type o, libecap::size_type s)
+Adaptation::Ecap::XactionRep::vbContent(libecap::size_type o, libecap::size_type s)
{
Must(canAccessVb);
// We may not be proxyingVb yet. It should be OK, but see vbContentShift().
}
void
-Ecap::XactionRep::vbContentShift(libecap::size_type n)
+Adaptation::Ecap::XactionRep::vbContentShift(libecap::size_type n)
{
Must(canAccessVb);
// We may not be proxyingVb yet. It should be OK now, but if BodyPipe
}
void
-Ecap::XactionRep::noteAbContentDone(bool atEnd)
+Adaptation::Ecap::XactionRep::noteAbContentDone(bool atEnd)
{
Must(proxyingAb == opOn);
stopProducingFor(answer().body_pipe, atEnd);
}
void
-Ecap::XactionRep::noteAbContentAvailable()
+Adaptation::Ecap::XactionRep::noteAbContentAvailable()
{
Must(proxyingAb == opOn);
moveAbContent();
#if 0 /* XXX: implement */
void
-Ecap::XactionRep::setAdaptedBodySize(const libecap::BodySize &size)
+Adaptation::Ecap::XactionRep::setAdaptedBodySize(const libecap::BodySize &size)
{
Must(answer().body_pipe != NULL);
if (size.known())
#endif
void
-Ecap::XactionRep::adaptationDelayed(const libecap::Delay &d)
+Adaptation::Ecap::XactionRep::adaptationDelayed(const libecap::Delay &d)
{
debugs(93,3, HERE << "adapter needs time: " <<
d.state << '/' << d.progress);
}
void
-Ecap::XactionRep::adaptationAborted()
+Adaptation::Ecap::XactionRep::adaptationAborted()
{
tellQueryAborted(true); // should eCAP support retries?
mustStop("adaptationAborted");
}
bool
-Ecap::XactionRep::callable() const
+Adaptation::Ecap::XactionRep::callable() const
{
return !done();
}
void
-Ecap::XactionRep::noteMoreBodySpaceAvailable(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteMoreBodySpaceAvailable(RefCount<BodyPipe> bp)
{
Must(proxyingAb == opOn);
moveAbContent();
}
void
-Ecap::XactionRep::noteBodyConsumerAborted(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteBodyConsumerAborted(RefCount<BodyPipe> bp)
{
Must(proxyingAb == opOn);
stopProducingFor(answer().body_pipe, false);
}
void
-Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
{
Must(proxyingVb == opOn);
Must(theMaster);
}
void
-Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
{
Must(proxyingVb == opOn);
Must(theMaster);
}
void
-Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> bp)
{
Must(proxyingVb == opOn);
Must(theMaster);
}
void
-Ecap::XactionRep::noteInitiatorAborted()
+Adaptation::Ecap::XactionRep::noteInitiatorAborted()
{
mustStop("initiator aborted");
}
// get content from the adapter and put it into the adapted pipe
void
-Ecap::XactionRep::moveAbContent()
+Adaptation::Ecap::XactionRep::moveAbContent()
{
Must(proxyingAb == opOn);
const libecap::Area c = theMaster->abContent(0, libecap::nsize);
}
const char *
-Ecap::XactionRep::status() const
+Adaptation::Ecap::XactionRep::status() const
{
static MemBuf buf;
buf.reset();
#include <libecap/host/xaction.h>
#include <libecap/adapter/xaction.h>
-namespace Ecap
-{
+namespace Adaptation {
+namespace Ecap {
/* The eCAP xaction representative maintains information about a single eCAP
xaction that Squid communicates with. One eCAP module may register many
};
} // namespace Ecap
+} // namespace Adaptation
#endif /* SQUID_ECAP_XACTION_REP_H */
#if USE_ECAP
#include "adaptation/ecap/Config.h"
-static void parse_ecap_service_type(Ecap::Config *);
-static void dump_ecap_service_type(StoreEntry *, const char *, const Ecap::Config &);
-static void free_ecap_service_type(Ecap::Config *);
+static void parse_ecap_service_type(Adaptation::Ecap::Config *);
+static void dump_ecap_service_type(StoreEntry *, const char *, const Adaptation::Ecap::Config &);
+static void free_ecap_service_type(Adaptation::Ecap::Config *);
#endif
CBDATA_TYPE(peer);
#if USE_ECAP
static void
-parse_ecap_service_type(Ecap::Config * cfg)
+parse_ecap_service_type(Adaptation::Ecap::Config * cfg)
{
cfg->parseService();
}
static void
-free_ecap_service_type(Ecap::Config * cfg)
+free_ecap_service_type(Adaptation::Ecap::Config * cfg)
{
cfg->freeService();
}
static void
-dump_ecap_service_type(StoreEntry * entry, const char *name, const Ecap::Config &cfg)
+dump_ecap_service_type(StoreEntry * entry, const char *name, const Adaptation::Ecap::Config &cfg)
{
cfg.dumpService(entry, name);
}
TYPE: onoff
IFDEF: USE_ECAP
COMMENT: on|off
-LOC: Ecap::TheConfig.onoff
+LOC: Adaptation::Ecap::TheConfig.onoff
DEFAULT: off
DOC_START
Controls whether eCAP support is enabled.
NAME: ecap_service
TYPE: ecap_service_type
IFDEF: USE_ECAP
-LOC: Ecap::TheConfig
+LOC: Adaptation::Ecap::TheConfig
DEFAULT: none
DOC_START
Defines a single eCAP service
enableAdaptation = Adaptation::Icap::TheConfig.onoff || enableAdaptation;
#endif
#if USE_ECAP
- Ecap::TheConfig.finalize(); // must be after we load modules
- enableAdaptation = Ecap::TheConfig.onoff || enableAdaptation;
+ Adaptation::Ecap::TheConfig.finalize(); // must be after we load modules
+ enableAdaptation = Adaptation::Ecap::TheConfig.onoff || enableAdaptation;
#endif
// must be the last adaptation-related finalize
Adaptation::Config::Finalize(enableAdaptation);