From: Alex Rousskov Date: Fri, 27 Feb 2009 16:38:06 +0000 (-0700) Subject: Moved Ecap namespace into Adaptation namespace, to match the sources directory X-Git-Tag: SQUID_3_2_0_1~1153^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=574b508c8fbdfa65689d79ca484e38c73cfa520f;p=thirdparty%2Fsquid.git Moved Ecap namespace into Adaptation namespace, to match the sources directory structure and Icap namespace placement. --- diff --git a/src/adaptation/ecap/Config.cc b/src/adaptation/ecap/Config.cc index 3a3b546d4f..17d30c8e07 100644 --- a/src/adaptation/ecap/Config.cc +++ b/src/adaptation/ecap/Config.cc @@ -10,28 +10,28 @@ #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 host(new Ecap::Host); + libecap::shared_ptr 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(); } diff --git a/src/adaptation/ecap/Config.h b/src/adaptation/ecap/Config.h index 5f3e11d1a9..9e2f69f0e7 100644 --- a/src/adaptation/ecap/Config.h +++ b/src/adaptation/ecap/Config.h @@ -9,8 +9,8 @@ #include "adaptation/Config.h" -namespace Ecap -{ +namespace Adaptation { +namespace Ecap { class Config: public Adaptation::Config { @@ -31,5 +31,6 @@ private: extern Config TheConfig; } // namespace Ecap +} // namespace Adaptation #endif /* SQUID_ECAP_CONFIG_H */ diff --git a/src/adaptation/ecap/Host.cc b/src/adaptation/ecap/Host.cc index 3406146691..62995d2661 100644 --- a/src/adaptation/ecap/Host.cc +++ b/src/adaptation/ecap/Host.cc @@ -5,14 +5,14 @@ #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); @@ -33,19 +33,19 @@ Ecap::Host::Host() } 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 &weak) +Adaptation::Ecap::Host::noteService(const libecap::weak_ptr &weak) { // Many ecap_service lines may use the same service URI. Find each // matching service rep, make sure it is an eCAP rep, @@ -87,7 +87,7 @@ SquidLogLevel(libecap::LogVerbosity lv) } 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 @@ -99,7 +99,7 @@ Ecap::Host::openDebug(libecap::LogVerbosity lv) } void -Ecap::Host::closeDebug(std::ostream *debug) +Adaptation::Ecap::Host::closeDebug(std::ostream *debug) { if (debug) Debug::finishDebug(); diff --git a/src/adaptation/ecap/Host.h b/src/adaptation/ecap/Host.h index 48fa1c3fdb..e0e0ef03ac 100644 --- a/src/adaptation/ecap/Host.h +++ b/src/adaptation/ecap/Host.h @@ -8,8 +8,8 @@ #include -namespace Ecap -{ +namespace Adaptation { +namespace Ecap { // Squid wrapper, providing host application functionality to eCAP services. class Host : public libecap::host::Host @@ -37,5 +37,6 @@ extern const libecap::Name protocolHtcp; #endif } // namespace Ecap +} // namespace Adaptation #endif /* SQUID_ECAP_HOST_H */ diff --git a/src/adaptation/ecap/MessageRep.cc b/src/adaptation/ecap/MessageRep.cc index 8560ab4a97..5888a88671 100644 --- a/src/adaptation/ecap/MessageRep.cc +++ b/src/adaptation/ecap/MessageRep.cc @@ -16,13 +16,13 @@ /* 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 @@ -31,8 +31,8 @@ Ecap::HeaderRep::hasAny(const Name &name) const (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 ? @@ -42,7 +42,7 @@ Ecap::HeaderRep::value(const Name &name) const } 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(), @@ -51,7 +51,7 @@ Ecap::HeaderRep::add(const Name &name, const Value &value) } 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) @@ -61,7 +61,7 @@ Ecap::HeaderRep::removeAny(const Name &name) } libecap::Area -Ecap::HeaderRep::image() const +Adaptation::Ecap::HeaderRep::image() const { MemBuf mb; mb.init(); @@ -75,7 +75,7 @@ Ecap::HeaderRep::image() const // throws on failures void -Ecap::HeaderRep::parse(const Area &buf) +Adaptation::Ecap::HeaderRep::parse(const Area &buf) { MemBuf mb; mb.init(); @@ -85,7 +85,7 @@ Ecap::HeaderRep::parse(const Area &buf) } http_hdr_type -Ecap::HeaderRep::TranslateHeaderId(const Name &name) +Adaptation::Ecap::HeaderRep::TranslateHeaderId(const Name &name) { if (name.assignedHostId()) return static_cast(name.hostId()); @@ -95,26 +95,26 @@ Ecap::HeaderRep::TranslateHeaderId(const Name &name) /* 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) { @@ -154,14 +154,14 @@ Ecap::FirstLineRep::protocol() const } 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(name.hostId()); @@ -171,13 +171,13 @@ Ecap::FirstLineRep::TranslateProtocolId(const Name &name) /* 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? @@ -188,15 +188,15 @@ Ecap::RequestLineRep::uri(const Area &aUri) 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(); @@ -210,8 +210,8 @@ Ecap::RequestLineRep::method(const Name &aMethod) } } -Ecap::RequestLineRep::Name -Ecap::RequestLineRep::method() const +Adaptation::Ecap::RequestLineRep::Name +Adaptation::Ecap::RequestLineRep::method() const { switch (theMessage.method.id()) { case METHOD_GET: @@ -234,25 +234,25 @@ Ecap::RequestLineRep::method() const } 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); } @@ -260,79 +260,79 @@ Ecap::RequestLineRep::protocol(const Name &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(code); } int -Ecap::StatusLineRep::statusCode() const +Adaptation::Ecap::StatusLineRep::statusCode() const { // TODO: see statusCode(code) TODO above return static_cast(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()); } @@ -340,7 +340,7 @@ Ecap::BodyRep::bodySize() const /* MessageRep */ -Ecap::MessageRep::MessageRep(HttpMsg *rawHeader): +Adaptation::Ecap::MessageRep::MessageRep(HttpMsg *rawHeader): theMessage(rawHeader), theFirstLineRep(NULL), theHeaderRep(NULL), theBodyRep(NULL) { @@ -360,7 +360,7 @@ Ecap::MessageRep::MessageRep(HttpMsg *rawHeader): theBodyRep = new BodyRep(theMessage.body_pipe); } -Ecap::MessageRep::~MessageRep() +Adaptation::Ecap::MessageRep::~MessageRep() { delete theBodyRep; delete theHeaderRep; @@ -368,7 +368,7 @@ Ecap::MessageRep::~MessageRep() } libecap::shared_ptr -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? @@ -382,37 +382,37 @@ Ecap::MessageRep::clone() const } 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() @@ -420,7 +420,7 @@ Ecap::MessageRep::addBody() } 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); @@ -430,7 +430,7 @@ Ecap::MessageRep::tieBody(Ecap::XactionRep *x) theBodyRep->tie(theMessage.body_pipe); } -const libecap::Body *Ecap::MessageRep::body() const +const libecap::Body *Adaptation::Ecap::MessageRep::body() const { return theBodyRep; } diff --git a/src/adaptation/ecap/MessageRep.h b/src/adaptation/ecap/MessageRep.h index adf62b9248..bcfbb474d9 100644 --- a/src/adaptation/ecap/MessageRep.h +++ b/src/adaptation/ecap/MessageRep.h @@ -19,8 +19,8 @@ class HttpMsg; class HttpRequest; class HttpReply; -namespace Ecap -{ +namespace Adaptation { +namespace Ecap { class XactionRep; @@ -172,6 +172,7 @@ private: BodyRep *theBodyRep; // body wrapper }; -} // namespace Ecap; +} // namespace Ecap +} // namespace Adaptation #endif /* SQUID__E_CAP__MESSAGE_REP_H */ diff --git a/src/adaptation/ecap/ServiceRep.cc b/src/adaptation/ecap/ServiceRep.cc index d579083d9a..d18e7d371e 100644 --- a/src/adaptation/ecap/ServiceRep.cc +++ b/src/adaptation/ecap/ServiceRep.cc @@ -4,16 +4,16 @@ #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; @@ -21,19 +21,19 @@ void Ecap::ServiceRep::noteService(const AdapterService &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) { @@ -42,24 +42,24 @@ Ecap::ServiceRep::finalize() } } -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()); @@ -70,7 +70,7 @@ Ecap::ServiceRep::makeXactLauncher(Adaptation::Initiator *initiator, } // 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()? diff --git a/src/adaptation/ecap/ServiceRep.h b/src/adaptation/ecap/ServiceRep.h index 1eadd36754..603a0d183a 100644 --- a/src/adaptation/ecap/ServiceRep.h +++ b/src/adaptation/ecap/ServiceRep.h @@ -11,8 +11,8 @@ #include #include -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 @@ -50,5 +50,6 @@ private: }; } // namespace Ecap +} // namespace Adaptation #endif /* SQUID_ECAP_SERVICE_REP_H */ diff --git a/src/adaptation/ecap/XactionRep.cc b/src/adaptation/ecap/XactionRep.cc index 055906d3a4..70b0d12a18 100644 --- a/src/adaptation/ecap/XactionRep.cc +++ b/src/adaptation/ecap/XactionRep.cc @@ -7,14 +7,14 @@ #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) { @@ -22,7 +22,7 @@ Ecap::XactionRep::XactionRep(Adaptation::Initiator *anInitiator, theCauseRep = new MessageRep(virginCause); } -Ecap::XactionRep::~XactionRep() +Adaptation::Ecap::XactionRep::~XactionRep() { assert(!theMaster); delete theCauseRep; @@ -30,7 +30,7 @@ Ecap::XactionRep::~XactionRep() } void -Ecap::XactionRep::master(const AdapterXaction &x) +Adaptation::Ecap::XactionRep::master(const AdapterXaction &x) { Must(!theMaster); Must(x != NULL); @@ -38,7 +38,7 @@ Ecap::XactionRep::master(const AdapterXaction &x) } void -Ecap::XactionRep::start() +Adaptation::Ecap::XactionRep::start() { Must(theMaster); @@ -51,7 +51,7 @@ Ecap::XactionRep::start() } void -Ecap::XactionRep::swanSong() +Adaptation::Ecap::XactionRep::swanSong() { // clear body_pipes, if any // this code does not maintain proxying* and canAccessVb states; should it? @@ -77,27 +77,27 @@ Ecap::XactionRep::swanSong() } 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(theAnswerRep.get()); Must(rep); @@ -105,7 +105,7 @@ Ecap::XactionRep::answer() } void -Ecap::XactionRep::terminateMaster() +Adaptation::Ecap::XactionRep::terminateMaster() { if (theMaster) { AdapterXaction x = theMaster; @@ -115,7 +115,7 @@ Ecap::XactionRep::terminateMaster() } bool -Ecap::XactionRep::doneAll() const +Adaptation::Ecap::XactionRep::doneAll() const { return proxyingVb >= opComplete && proxyingAb >= opComplete && Adaptation::Initiate::doneAll(); @@ -123,7 +123,7 @@ Ecap::XactionRep::doneAll() const // 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); @@ -140,7 +140,7 @@ Ecap::XactionRep::dropVirgin(const char *reason) } void -Ecap::XactionRep::useVirgin() +Adaptation::Ecap::XactionRep::useVirgin() { debugs(93,3, HERE << status()); Must(proxyingAb == opUndecided); @@ -170,7 +170,7 @@ Ecap::XactionRep::useVirgin() } void -Ecap::XactionRep::useAdapted(const libecap::shared_ptr &m) +Adaptation::Ecap::XactionRep::useAdapted(const libecap::shared_ptr &m) { debugs(93,3, HERE << status()); Must(m); @@ -197,7 +197,7 @@ Ecap::XactionRep::useAdapted(const libecap::shared_ptr &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 @@ -206,7 +206,7 @@ Ecap::XactionRep::vbDiscard() } void -Ecap::XactionRep::vbMake() +Adaptation::Ecap::XactionRep::vbMake() { Must(proxyingVb == opUndecided); BodyPipePointer &p = theVirginRep.raw().body_pipe; @@ -216,7 +216,7 @@ Ecap::XactionRep::vbMake() } void -Ecap::XactionRep::vbStopMaking() +Adaptation::Ecap::XactionRep::vbStopMaking() { // if adapter does not need vb, we do not need to receive it if (proxyingVb == opOn) @@ -225,7 +225,7 @@ Ecap::XactionRep::vbStopMaking() } 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 @@ -233,7 +233,7 @@ Ecap::XactionRep::vbMakeMore() } 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(). @@ -258,7 +258,7 @@ Ecap::XactionRep::vbContent(libecap::size_type o, libecap::size_type s) } 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 @@ -273,7 +273,7 @@ Ecap::XactionRep::vbContentShift(libecap::size_type n) } void -Ecap::XactionRep::noteAbContentDone(bool atEnd) +Adaptation::Ecap::XactionRep::noteAbContentDone(bool atEnd) { Must(proxyingAb == opOn); stopProducingFor(answer().body_pipe, atEnd); @@ -281,7 +281,7 @@ Ecap::XactionRep::noteAbContentDone(bool atEnd) } void -Ecap::XactionRep::noteAbContentAvailable() +Adaptation::Ecap::XactionRep::noteAbContentAvailable() { Must(proxyingAb == opOn); moveAbContent(); @@ -289,7 +289,7 @@ Ecap::XactionRep::noteAbContentAvailable() #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()) @@ -299,7 +299,7 @@ Ecap::XactionRep::setAdaptedBodySize(const libecap::BodySize &size) #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); @@ -307,27 +307,27 @@ Ecap::XactionRep::adaptationDelayed(const libecap::Delay &d) } 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 bp) +Adaptation::Ecap::XactionRep::noteMoreBodySpaceAvailable(RefCount bp) { Must(proxyingAb == opOn); moveAbContent(); } void -Ecap::XactionRep::noteBodyConsumerAborted(RefCount bp) +Adaptation::Ecap::XactionRep::noteBodyConsumerAborted(RefCount bp) { Must(proxyingAb == opOn); stopProducingFor(answer().body_pipe, false); @@ -337,7 +337,7 @@ Ecap::XactionRep::noteBodyConsumerAborted(RefCount bp) } void -Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount bp) +Adaptation::Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount bp) { Must(proxyingVb == opOn); Must(theMaster); @@ -345,7 +345,7 @@ Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount bp) } void -Ecap::XactionRep::noteBodyProductionEnded(RefCount bp) +Adaptation::Ecap::XactionRep::noteBodyProductionEnded(RefCount bp) { Must(proxyingVb == opOn); Must(theMaster); @@ -354,7 +354,7 @@ Ecap::XactionRep::noteBodyProductionEnded(RefCount bp) } void -Ecap::XactionRep::noteBodyProducerAborted(RefCount bp) +Adaptation::Ecap::XactionRep::noteBodyProducerAborted(RefCount bp) { Must(proxyingVb == opOn); Must(theMaster); @@ -363,14 +363,14 @@ Ecap::XactionRep::noteBodyProducerAborted(RefCount bp) } 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); @@ -380,7 +380,7 @@ Ecap::XactionRep::moveAbContent() } const char * -Ecap::XactionRep::status() const +Adaptation::Ecap::XactionRep::status() const { static MemBuf buf; buf.reset(); diff --git a/src/adaptation/ecap/XactionRep.h b/src/adaptation/ecap/XactionRep.h index 1a749cd9e5..d1d411bf2a 100644 --- a/src/adaptation/ecap/XactionRep.h +++ b/src/adaptation/ecap/XactionRep.h @@ -16,8 +16,8 @@ #include #include -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 @@ -97,5 +97,6 @@ private: }; } // namespace Ecap +} // namespace Adaptation #endif /* SQUID_ECAP_XACTION_REP_H */ diff --git a/src/cache_cf.cc b/src/cache_cf.cc index c00ef66639..66cd44d480 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -81,9 +81,9 @@ static void parse_icap_access_type(); #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); @@ -3547,19 +3547,19 @@ parse_icap_access_type() #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); } diff --git a/src/cf.data.pre b/src/cf.data.pre index 9a7e51fac1..1610005464 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -5363,7 +5363,7 @@ NAME: ecap_enable 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. @@ -5372,7 +5372,7 @@ DOC_END 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 diff --git a/src/main.cc b/src/main.cc index 3a1612da25..c9672b4463 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1054,8 +1054,8 @@ mainInitialize(void) 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);