]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved Ecap namespace into Adaptation namespace, to match the sources directory
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Feb 2009 16:38:06 +0000 (09:38 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Feb 2009 16:38:06 +0000 (09:38 -0700)
structure and Icap namespace placement.

13 files changed:
src/adaptation/ecap/Config.cc
src/adaptation/ecap/Config.h
src/adaptation/ecap/Host.cc
src/adaptation/ecap/Host.h
src/adaptation/ecap/MessageRep.cc
src/adaptation/ecap/MessageRep.h
src/adaptation/ecap/ServiceRep.cc
src/adaptation/ecap/ServiceRep.h
src/adaptation/ecap/XactionRep.cc
src/adaptation/ecap/XactionRep.h
src/cache_cf.cc
src/cf.data.pre
src/main.cc

index 3a3b546d4f68741a5a23e23ac391b092faed7a7b..17d30c8e079a554691329395d1c540972bb5f768 100644 (file)
 #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();
 }
 
index 5f3e11d1a9e93c4bb8ac09d164733ab2bf5d2e60..9e2f69f0e70c3c16b15001554cbedeb41f81b0ca 100644 (file)
@@ -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 */
index 34061466916e0bbd72f76c44be0951f6ae19a98c..62995d2661c246f0d666032bd4285ea6a838b617 100644 (file)
@@ -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<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,
@@ -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();
index 48fa1c3fdbaacc4f4c2427108611a84667b25d2c..e0e0ef03ac4c0f4157059bcf265decde21d7c038 100644 (file)
@@ -8,8 +8,8 @@
 
 #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
@@ -37,5 +37,6 @@ extern const libecap::Name protocolHtcp;
 #endif
 
 } // namespace Ecap
+} // namespace Adaptation
 
 #endif /* SQUID_ECAP_HOST_H */
index 8560ab4a9700825762b9e5370a93a28b0f93d52e..5888a8867179e2c5e694ff11775b1abbf4bdfbfb 100644 (file)
 
 /* 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<http_hdr_type>(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<protocol_t>(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<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());
 }
@@ -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<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?
@@ -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;
 }
index adf62b9248419489272b62bfcf0b4838b030e963..bcfbb474d9fca14f1488c819ea3ba4f3fa9ee66f 100644 (file)
@@ -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 */
index d579083d9a63cc3adaa93b58d35836921198bf93..d18e7d371e6dc97608c4b2d84262f975bae509c0 100644 (file)
@@ -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()?
index 1eadd36754c2f9d2a05352567320c05c15019bd9..603a0d183a6187e57b7ef714443f35a1ffa16fe1 100644 (file)
@@ -11,8 +11,8 @@
 #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
@@ -50,5 +50,6 @@ private:
 };
 
 } // namespace Ecap
+} // namespace Adaptation
 
 #endif /* SQUID_ECAP_SERVICE_REP_H */
index 055906d3a4d57a863af4d97dbb8f3d15cacf2f08..70b0d12a18898e93f6ed34c3757ab2629f260c80 100644 (file)
@@ -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<MessageRep*>(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<libecap::Message> &m)
+Adaptation::Ecap::XactionRep::useAdapted(const libecap::shared_ptr<libecap::Message> &m)
 {
     debugs(93,3, HERE << status());
     Must(m);
@@ -197,7 +197,7 @@ Ecap::XactionRep::useAdapted(const libecap::shared_ptr<libecap::Message> &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<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);
@@ -337,7 +337,7 @@ Ecap::XactionRep::noteBodyConsumerAborted(RefCount<BodyPipe> bp)
 }
 
 void
-Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
 {
     Must(proxyingVb == opOn);
     Must(theMaster);
@@ -345,7 +345,7 @@ Ecap::XactionRep::noteMoreBodyDataAvailable(RefCount<BodyPipe> bp)
 }
 
 void
-Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
 {
     Must(proxyingVb == opOn);
     Must(theMaster);
@@ -354,7 +354,7 @@ Ecap::XactionRep::noteBodyProductionEnded(RefCount<BodyPipe> bp)
 }
 
 void
-Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> bp)
+Adaptation::Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> bp)
 {
     Must(proxyingVb == opOn);
     Must(theMaster);
@@ -363,14 +363,14 @@ Ecap::XactionRep::noteBodyProducerAborted(RefCount<BodyPipe> 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();
index 1a749cd9e595940c7bdcdc692435988b9906d939..d1d411bf2a8dd34fa69dcb63353e02eb8c621c9e 100644 (file)
@@ -16,8 +16,8 @@
 #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
@@ -97,5 +97,6 @@ private:
 };
 
 } // namespace Ecap
+} // namespace Adaptation
 
 #endif /* SQUID_ECAP_XACTION_REP_H */
index c00ef66639c1ce9e4eda2de64bc8a36c24659b3e..66cd44d480baa8edca6f05cc6075deb2e36acec1 100644 (file)
@@ -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);
 }
index 9a7e51fac1b8fd4096865e6a9119e7859aeb441f..1610005464dc1ac9269303b4b69165b8c4163197 100644 (file)
@@ -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
index 3a1612da25f7364403163807cb40f67e993a8205..c9672b44634819d81882db76673e28e22fbb170b 100644 (file)
@@ -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);