]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceLayout: move HttpMsg into libhttp as Http::Message
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Feb 2017 11:51:56 +0000 (00:51 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 16 Feb 2017 11:51:56 +0000 (00:51 +1300)
* move files and rename the class

* add http/forward.h entries for Message and MessagePointer
 (replacing the HttpMsg::Pointer typedef)

* remove unnecessary includes for HttpMsg.h and HttpRequest.h

Also, some minor cleanup within the class files reducing debugs()
duplication, function/method coding style and doxtgen'ating some
code comments.

53 files changed:
src/HttpReply.cc
src/HttpReply.h
src/HttpRequest.cc
src/HttpRequest.h
src/Makefile.am
src/MemObject.cc
src/acl/ConnectionsEncrypted.cc
src/adaptation/Answer.cc
src/adaptation/Answer.h
src/adaptation/Initiate.cc
src/adaptation/Iterator.cc
src/adaptation/Iterator.h
src/adaptation/Message.cc
src/adaptation/Message.h
src/adaptation/Service.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/adaptation/icap/InOut.h
src/adaptation/icap/Launcher.cc
src/adaptation/icap/ModXact.cc
src/adaptation/icap/ModXact.h
src/adaptation/icap/OptXact.cc
src/adaptation/icap/ServiceRep.cc
src/adaptation/icap/ServiceRep.h
src/adaptation/icap/Xaction.cc
src/adaptation/icap/Xaction.h
src/auth/basic/UserRequest.cc
src/auth/ntlm/UserRequest.cc
src/client_side.cc
src/client_side_request.cc
src/client_side_request.h
src/clients/Client.cc
src/clients/Client.h
src/clients/FtpGateway.cc
src/clients/FtpRelay.cc
src/format/Format.cc
src/ftp/Elements.cc
src/ftp/Elements.h
src/gopher.cc
src/http.cc
src/http/Makefile.am
src/http/Message.cc [moved from src/HttpMsg.cc with 80% similarity]
src/http/Message.h [moved from src/HttpMsg.h with 84% similarity]
src/http/StatusLine.cc
src/http/forward.h
src/tests/stub_HttpReply.cc
src/tests/stub_HttpRequest.cc
src/tunnel.cc
src/whois.cc

index e40a1320b02a92f8d131e564d79955a90b22ec74..16057b7e7231e774cc02dddc70cd6ef99d1e8047 100644 (file)
@@ -25,7 +25,7 @@
 #include "Store.h"
 #include "StrList.h"
 
-HttpReply::HttpReply() : HttpMsg(hoReply), date (0), last_modified (0),
+HttpReply::HttpReply() : Http::Message(hoReply), date (0), last_modified (0),
     expires (0), surrogate_control (NULL), content_range (NULL), keep_alive (0),
     protoPrefix("HTTP/"), bodySizeMax(-2)
 {
@@ -308,7 +308,7 @@ HttpReply::hdrExpirationTime()
 void
 HttpReply::hdrCacheInit()
 {
-    HttpMsg::hdrCacheInit();
+    Http::Message::hdrCacheInit();
 
     http_ver = sline.version;
     content_length = header.getInt64(Http::HdrType::CONTENT_LENGTH);
@@ -443,7 +443,7 @@ HttpReply::parseFirstLine(const char *blk_start, const char *blk_end)
 int
 HttpReply::httpMsgParseError()
 {
-    int result(HttpMsg::httpMsgParseError());
+    int result(Http::Message::httpMsgParseError());
     /* indicate an error in the status line */
     sline.set(Http::ProtocolVersion(), Http::scInvalidHeader);
     return result;
@@ -553,7 +553,8 @@ HttpReply::clone() const
     return rep;
 }
 
-bool HttpReply::inheritProperties(const HttpMsg *aMsg)
+bool
+HttpReply::inheritProperties(const Http::Message *aMsg)
 {
     const HttpReply *aRep = dynamic_cast<const HttpReply*>(aMsg);
     if (!aRep)
index 36418cf1a74fb5c43d0f02bf2c8cc97b67a188ed..c2177e92c713424a270eb4bcc2f03aaa1a193fa0 100644 (file)
@@ -11,7 +11,6 @@
 
 #include "http/StatusLine.h"
 #include "HttpBody.h"
-#include "HttpMsg.h"
 #include "HttpRequest.h"
 
 void httpReplyInitModule(void);
@@ -22,7 +21,7 @@ class HttpHdrContRange;
 
 class HttpHdrSc;
 
-class HttpReply: public HttpMsg
+class HttpReply: public Http::Message
 {
     MEMPROXY_CLASS(HttpReply);
 
@@ -70,7 +69,7 @@ public:
 
     virtual bool expectingBody(const HttpRequestMethod&, int64_t&) const;
 
-    virtual bool inheritProperties(const HttpMsg *aMsg);
+    virtual bool inheritProperties(const Http::Message *);
 
     bool updateOnNotModified(HttpReply const *other);
 
index 3c5d05ed94e270fc5296175d312157eca692ccad..bcd0b7fa65bd56279f4e91063f88730ca9a47896 100644 (file)
 #endif
 
 HttpRequest::HttpRequest() :
-    HttpMsg(hoRequest)
+    Http::Message(hoRequest)
 {
     init();
 }
 
 HttpRequest::HttpRequest(const HttpRequestMethod& aMethod, AnyP::ProtocolType aProtocol, const char *aSchemeImg, const char *aUrlpath) :
-    HttpMsg(hoRequest)
+    Http::Message(hoRequest)
 {
     static unsigned int id = 1;
     debugs(93,7, HERE << "constructed, this=" << this << " id=" << ++id);
@@ -207,7 +207,7 @@ HttpRequest::clone() const
 }
 
 bool
-HttpRequest::inheritProperties(const HttpMsg *aMsg)
+HttpRequest::inheritProperties(const Http::Message *aMsg)
 {
     const HttpRequest* aReq = dynamic_cast<const HttpRequest*>(aMsg);
     if (!aReq)
@@ -386,7 +386,7 @@ HttpRequest::prefixLen() const
 void
 HttpRequest::hdrCacheInit()
 {
-    HttpMsg::hdrCacheInit();
+    Http::Message::hdrCacheInit();
 
     assert(!range);
     range = header.getRange();
index e84c73878586a958e12c0752f320d7d746373f9a..5c097042cd36593a9168eb1c9f6df1af3a031067 100644 (file)
@@ -13,8 +13,8 @@
 #include "dns/forward.h"
 #include "err_type.h"
 #include "HierarchyLogEntry.h"
+#include "http/Message.h"
 #include "http/RequestMethod.h"
-#include "HttpMsg.h"
 #include "Notes.h"
 #include "RequestFlags.h"
 #include "URL.h"
@@ -41,7 +41,7 @@ void httpRequestPack(void *obj, Packable *p);
 
 class HttpHdrRange;
 
-class HttpRequest: public HttpMsg
+class HttpRequest: public Http::Message
 {
     MEMPROXY_CLASS(HttpRequest);
 
@@ -236,7 +236,7 @@ protected:
 
     virtual void hdrCacheInit();
 
-    virtual bool inheritProperties(const HttpMsg *aMsg);
+    virtual bool inheritProperties(const Http::Message *);
 };
 
 class ConnStateData;
index 29269f3308b46531029caf0c18048d913bf656bf..cc4ae2c2c98eb3e263e2bd113eae8855bc8561c6 100644 (file)
@@ -335,8 +335,6 @@ squid_SOURCES = \
        HttpBody.cc \
        HttpControlMsg.cc \
        HttpControlMsg.h \
-       HttpMsg.cc \
-       HttpMsg.h \
        HttpReply.cc \
        HttpReply.h \
        RequestFlags.h \
@@ -943,8 +941,6 @@ tests_testHttpReply_SOURCES=\
        HttpHeaderTools.cc \
        HttpControlMsg.cc \
        HttpControlMsg.h \
-       HttpMsg.cc \
-       HttpMsg.h \
        HttpReply.cc \
        HttpReply.h \
        MasterXaction.cc \
@@ -1044,7 +1040,6 @@ tests_testACLMaxUserIP_SOURCES= \
        HttpHdrCc.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       HttpMsg.cc \
        int.h \
        int.cc \
        MasterXaction.cc \
@@ -1272,7 +1267,6 @@ tests_testCacheManager_SOURCES = \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        icp_v2.cc \
        icp_v3.cc \
@@ -1461,7 +1455,6 @@ tests_testDiskIO_SOURCES = \
        HttpHeaderTools.cc \
        HttpHeader.h \
        HttpHeader.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        int.h \
        int.cc \
@@ -1691,7 +1684,6 @@ tests_testEvent_SOURCES = \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        PeerPoolMgr.h \
        PeerPoolMgr.cc \
@@ -1927,7 +1919,6 @@ tests_testEventLoop_SOURCES = \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        PeerPoolMgr.h \
        PeerPoolMgr.cc \
@@ -2158,7 +2149,6 @@ tests_test_http_range_SOURCES = \
        HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        PeerPoolMgr.h \
        PeerPoolMgr.cc \
@@ -2473,7 +2463,6 @@ tests_testHttpRequest_SOURCES = \
        HttpHdrRange.cc \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        icp_v2.cc \
        icp_v3.cc \
@@ -2707,7 +2696,6 @@ tests_testStore_SOURCES= \
        HttpHeaderTools.cc \
        HttpHeader.h \
        HttpHeader.cc \
-       HttpMsg.cc \
        RequestFlags.cc \
        RequestFlags.h \
        int.h \
@@ -2959,7 +2947,6 @@ tests_testUfs_SOURCES = \
        tests/stub_CacheDigest.cc \
        ConfigParser.cc \
        EventLoop.cc \
-       HttpMsg.cc \
        RemovalPolicy.cc \
        repl_modules.h \
        store.cc \
@@ -3116,7 +3103,6 @@ tests_testRock_SOURCES = \
        HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        int.h \
        int.cc \
@@ -3315,7 +3301,6 @@ tests_testURL_SOURCES = \
        HttpHeaderFieldInfo.h \
        HttpHeaderTools.h \
        HttpHeaderTools.cc \
-       HttpMsg.cc \
        HttpReply.cc \
        PeerPoolMgr.h \
        PeerPoolMgr.cc \
index 10a06bc800384b4e9d1fe8ef66b3d030b7b0afec..aeb265cafc8b688a63007353bdc157bcfc06f79e 100644 (file)
@@ -285,7 +285,7 @@ MemObject::expectedReplySize() const
     if (_reply) {
         const int64_t clen = _reply->bodySize(method);
         debugs(20, 7, HERE << "clen: " << clen);
-        if (clen >= 0 && _reply->hdr_sz > 0) // yuck: HttpMsg sets hdr_sz to 0
+        if (clen >= 0 && _reply->hdr_sz > 0) // yuck: Http::Message sets hdr_sz to 0
             return clen + _reply->hdr_sz;
     }
 
index 19b33a571e8f509060e4b7aeba5c412d66df092a..890f6d426b801c4424a16f7a4cd8722c1259f98e 100644 (file)
@@ -63,9 +63,9 @@ Acl::ConnectionsEncrypted::match(ACLChecklist *checklist)
     ACLFilledChecklist *filled = Filled((ACLChecklist*)checklist);
 
     const bool safeRequest =
-        !(filled->request->sources & HttpMsg::srcUnsafe);
+        !(filled->request->sources & Http::Message::srcUnsafe);
     const bool safeReply = !filled->reply ||
-                           !(filled->reply->sources & HttpMsg::srcUnsafe);
+                           !(filled->reply->sources & Http::Message::srcUnsafe);
 
     return (safeRequest && safeReply) ? 1 : 0;
 }
index 76bd568421c38d974909faac4968cc7691334b2d..5164a1756bc04992be8688bc454c96e92e419d27 100644 (file)
@@ -11,6 +11,7 @@
 #include "squid.h"
 #include "adaptation/Answer.h"
 #include "base/AsyncJobCalls.h"
+#include "http/Message.h"
 
 Adaptation::Answer
 Adaptation::Answer::Error(bool final)
@@ -22,7 +23,7 @@ Adaptation::Answer::Error(bool final)
 }
 
 Adaptation::Answer
-Adaptation::Answer::Forward(HttpMsg *aMsg)
+Adaptation::Answer::Forward(Http::Message *aMsg)
 {
     Answer answer(akForward);
     answer.message = aMsg;
index 2c38597d4f0b2fd9b10b1d14a8b528ac92329e7b..c2a5cb70dfc12929088412832b448a42ee888cab 100644 (file)
@@ -10,7 +10,8 @@
 #define SQUID_ADAPTATION__ANSWER_H
 
 #include "adaptation/forward.h"
-#include "HttpMsg.h"
+#include "http/forward.h"
+#include "SquidString.h"
 
 #include <iosfwd>
 
@@ -29,13 +30,13 @@ public:
     } Kind;
 
     static Answer Error(bool final); ///< create an akError answer
-    static Answer Forward(HttpMsg *aMsg); ///< create an akForward answer
+    static Answer Forward(Http::Message *aMsg); ///< create an akForward answer
     static Answer Block(const String &aRule); ///< create an akBlock answer
 
     std::ostream &print(std::ostream &os) const;
 
 public:
-    HttpMsg::Pointer message; ///< HTTP request or response to forward
+    Http::MessagePointer message; ///< HTTP request or response to forward
     String ruleId; ///< ACL (or similar rule) name that blocked forwarding
     bool final; ///< whether the error, if any, cannot be bypassed
     Kind kind; ///< the type of the answer
index d3ac320e7fd1382593e52149fb0967e7fd687576..10df0cebf6bf6c771ee9254bf3283707396c7861 100644 (file)
@@ -13,7 +13,7 @@
 #include "adaptation/Initiate.h"
 #include "adaptation/Initiator.h"
 #include "base/AsyncJobCalls.h"
-#include "HttpMsg.h"
+#include "http/Message.h"
 
 namespace Adaptation
 {
index e32f38bad0b6f7a1016971260c17fea8d7b196e5..3c37879987fe69996993e54cb2f9fc3ff2e20986 100644 (file)
 #include "adaptation/ServiceFilter.h"
 #include "adaptation/ServiceGroups.h"
 #include "base/TextException.h"
-#include "HttpMsg.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 #include "sbuf/StringConvert.h"
 
 Adaptation::Iterator::Iterator(
-    HttpMsg *aMsg, HttpRequest *aCause,
+    Http::Message *aMsg, HttpRequest *aCause,
     AccessLogEntry::Pointer &alp,
     const ServiceGroupPointer &aGroup):
     AsyncJob("Iterator"),
@@ -118,7 +116,7 @@ Adaptation::Iterator::noteAdaptationAnswer(const Answer &answer)
 {
     switch (answer.kind) {
     case Answer::akForward:
-        handleAdaptedHeader(const_cast<HttpMsg*>(answer.message.getRaw()));
+        handleAdaptedHeader(const_cast<Http::Message*>(answer.message.getRaw()));
         break;
 
     case Answer::akBlock:
@@ -132,7 +130,7 @@ Adaptation::Iterator::noteAdaptationAnswer(const Answer &answer)
 }
 
 void
-Adaptation::Iterator::handleAdaptedHeader(HttpMsg *aMsg)
+Adaptation::Iterator::handleAdaptedHeader(Http::Message *aMsg)
 {
     // set theCause if we switched to request satisfaction mode
     if (!theCause) { // probably sent a request message
index fd2f5f5d4f87936b5c82f9d399a7c3b9c1ac0100..c451f2acddfcc66fce92abcff09788198f428728 100644 (file)
@@ -13,9 +13,7 @@
 #include "adaptation/Initiate.h"
 #include "adaptation/Initiator.h"
 #include "adaptation/ServiceGroups.h"
-
-class HttpMsg;
-class HttpRequest;
+#include "http/forward.h"
 
 namespace Adaptation
 {
@@ -35,7 +33,7 @@ class Iterator: public Initiate, public Initiator
     CBDATA_CLASS(Iterator);
 
 public:
-    Iterator(HttpMsg *virginHeader, HttpRequest *virginCause,
+    Iterator(Http::Message *virginHeader, HttpRequest *virginCause,
              AccessLogEntry::Pointer &alp,
              const Adaptation::ServiceGroupPointer &aGroup);
     virtual ~Iterator();
@@ -61,13 +59,13 @@ protected:
     /// creates service filter for the current step
     ServiceFilter filter() const;
 
-    void handleAdaptedHeader(HttpMsg *msg);
+    void handleAdaptedHeader(Http::Message *msg);
     void handleAdaptationBlock(const Answer &answer);
     void handleAdaptationError(bool final);
 
     ServiceGroupPointer theGroup; ///< the service group we are iterating
     ServicePlan thePlan; ///< which services to use and in what order
-    HttpMsg *theMsg; ///< the message being adapted (virgin for each step)
+    Http::Message *theMsg; ///< the message being adapted (virgin for each step)
     HttpRequest *theCause; ///< the cause of the original virgin message
     AccessLogEntry::Pointer al; ///< info for the future access.log entry
     CbcPointer<Adaptation::Initiate> theLauncher; ///< current transaction launcher
index e0638e43cddc3dae3ff3a2c5538d15f5b552f78a..1e7791dca5dc6c1af53539fe17c3a84b91de80f1 100644 (file)
@@ -11,7 +11,8 @@
 #include "squid.h"
 #include "adaptation/Message.h"
 #include "base/TextException.h"
-#include "HttpMsg.h"
+#include "BodyPipe.h"
+#include "http/Message.h"
 
 Adaptation::Message::Message(): header(NULL)
 {
index ba52d82dcb28235f2be092e11d3b37d160a48339..9b58fb3db71fdc15a17c0fd83449db77e347ff67 100644 (file)
@@ -10,8 +10,8 @@
 #define SQUID__ADAPTATION__MESSAGE_H
 
 #include "base/RefCount.h"
+#include "http/forward.h"
 
-class HttpMsg;
 class BodyPipe;
 typedef RefCount<BodyPipe> BodyPipePointer;
 
@@ -21,12 +21,12 @@ namespace Adaptation
 // Manages the header and the body of an HTTP message being worked on.
 // Adaptation transactions use this class for virgin and adapted HTTP messages.
 // TODO: remove this class after adding refcounted message pointers and
-// after making sure nobody abruptly clears the HttpMsg::body_pipe pointer.
+// after making sure nobody abruptly clears the Http::Message::body_pipe pointer.
 class Message
 {
 
 public:
-    typedef HttpMsg Header;
+    typedef Http::Message Header;
 
     Message();
     Message(Header *aHeader);
index 6e3f3fea6dc8cb18e0b2e120126cbf8cb116f64f..eb6d8a4d986aad10df5e0e3fef9570c715c3d970 100644 (file)
 #include "adaptation/forward.h"
 #include "adaptation/ServiceConfig.h"
 #include "base/RefCount.h"
+#include "http/forward.h"
 #include "SquidString.h"
 
 // TODO: Move src/ICAP/ICAPServiceRep.h API comments here and update them
 
-class HttpMsg;
-class HttpRequest;
-
 namespace Adaptation
 {
 
@@ -40,7 +38,7 @@ public:
     virtual bool broken() const;
     virtual bool up() const = 0; // see comments above
 
-    virtual Initiate *makeXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp) = 0;
+    virtual Initiate *makeXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp) = 0;
 
     bool wants(const ServiceFilter &filter) const;
 
index 99a1c151dcd088f6137ccddfeb34cb6230a4a22b..fdd890c9c9c76c497aa008c95521cec39fc2c992 100644 (file)
@@ -24,7 +24,7 @@
 
 /* HeaderRep */
 
-Adaptation::Ecap::HeaderRep::HeaderRep(HttpMsg &aMessage): theHeader(aMessage.header),
+Adaptation::Ecap::HeaderRep::HeaderRep(Http::Message &aMessage): theHeader(aMessage.header),
     theMessage(aMessage)
 {
 }
@@ -112,7 +112,7 @@ Adaptation::Ecap::HeaderRep::TranslateHeaderId(const Name &name)
 
 /* FirstLineRep */
 
-Adaptation::Ecap::FirstLineRep::FirstLineRep(HttpMsg &aMessage): theMessage(aMessage)
+Adaptation::Ecap::FirstLineRep::FirstLineRep(Http::Message &aMessage): theMessage(aMessage)
 {
 }
 
@@ -359,7 +359,7 @@ Adaptation::Ecap::BodyRep::bodySize() const
 
 /* MessageRep */
 
-Adaptation::Ecap::MessageRep::MessageRep(HttpMsg *rawHeader):
+Adaptation::Ecap::MessageRep::MessageRep(Http::Message *rawHeader):
     theMessage(rawHeader), theFirstLineRep(NULL),
     theHeaderRep(NULL), theBodyRep(NULL)
 {
@@ -388,7 +388,7 @@ Adaptation::Ecap::MessageRep::~MessageRep()
 libecap::shared_ptr<libecap::Message>
 Adaptation::Ecap::MessageRep::clone() const
 {
-    HttpMsg *hdr = theMessage.header->clone();
+    Http::Message *hdr = theMessage.header->clone();
     hdr->body_pipe = NULL; // if any; TODO: remove pipe cloning from ::clone?
     libecap::shared_ptr<libecap::Message> res(new MessageRep(hdr));
 
index 5e9579e63b0a5f7fd9c0e72cbb5453f10639b63c..03d830df16470df3f730ea3399bd3948270626ce 100644 (file)
 #include "adaptation/Message.h"
 #include "anyp/ProtocolType.h"
 #include "BodyPipe.h"
+#include "http/forward.h"
 #include "HttpHeader.h"
+
 #include <libecap/common/message.h>
 #include <libecap/common/header.h>
 #include <libecap/common/body.h>
 
-class HttpMsg;
-class HttpRequest;
-class HttpReply;
-
 namespace Adaptation
 {
 namespace Ecap
@@ -31,7 +29,7 @@ namespace Ecap
 
 class XactionRep;
 
-// Translates Squid HttpMsg into libecap::Header.
+// Translates Squid Http::Message into libecap::Header.
 class HeaderRep: public libecap::Header
 {
 public:
@@ -39,7 +37,7 @@ public:
     typedef libecap::Area Area;
 
 public:
-    HeaderRep(HttpMsg &aMessage);
+    HeaderRep(Http::Message &aMessage);
 
     /* libecap::Header API */
     virtual bool hasAny(const Name &name) const;
@@ -55,17 +53,17 @@ protected:
 
 private:
     HttpHeader &theHeader; // the header being translated to libecap
-    HttpMsg &theMessage;   // the message being translated to libecap
+    Http::Message &theMessage;   // the message being translated to libecap
 };
 
-// Helps translate Squid HttpMsg into libecap::FirstLine (see children).
+// Helps translate Squid Http::Message into libecap::FirstLine (see children).
 class FirstLineRep
 {
 public:
     typedef libecap::Name Name;
 
 public:
-    FirstLineRep(HttpMsg &aMessage);
+    FirstLineRep(Http::Message &aMessage);
 
     libecap::Version version() const;
     void version(const libecap::Version &aVersion);
@@ -76,7 +74,7 @@ protected:
     static AnyP::ProtocolType TranslateProtocolId(const Name &name);
 
 private:
-    HttpMsg &theMessage; // the message which first line is being translated
+    Http::Message &theMessage; // the message which first line is being translated
 };
 
 // Translates Squid HttpRequest into libecap::RequestLine.
@@ -149,7 +147,7 @@ private:
 class MessageRep: public libecap::Message
 {
 public:
-    explicit MessageRep(HttpMsg *rawHeader);
+    explicit MessageRep(Http::Message *rawHeader);
     virtual ~MessageRep();
 
     /* libecap::Message API */
index 94c2f4ef0ed1d32c41e2c0b7f73b06bc97058669..7983d069125bc357dbbecf6724880a6da954f0ce 100644 (file)
@@ -248,7 +248,7 @@ bool Adaptation::Ecap::ServiceRep::wantsUrl(const SBuf &urlPath) const
 }
 
 Adaptation::Initiate *
-Adaptation::Ecap::ServiceRep::makeXactLauncher(HttpMsg *virgin,
+Adaptation::Ecap::ServiceRep::makeXactLauncher(Http::Message *virgin,
         HttpRequest *cause, AccessLogEntry::Pointer &alp)
 {
     Must(up());
index b4c92561149c3d1fd1c72d47f11a788eb3407137..4927d17349983c3ed92f786c84d297008486afc0 100644 (file)
@@ -37,7 +37,7 @@ public:
     virtual void finalize();
     virtual bool probed() const;
     virtual bool up() const;
-    virtual Adaptation::Initiate *makeXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp);
+    virtual Adaptation::Initiate *makeXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp);
     virtual bool wantsUrl(const SBuf &urlPath) const;
     virtual void noteFailure();
     virtual const char *status() const;
index 5189f50e9a1b99375fca421bd2a11746fa16419a..0645a71e8bb7b44eedbbe9fef89ebced1f1aa27d 100644 (file)
@@ -45,7 +45,7 @@ public:
 };
 
 Adaptation::Ecap::XactionRep::XactionRep(
-    HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp,
+    Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp,
     const Adaptation::ServicePointer &aService):
     AsyncJob("Adaptation::Ecap::XactionRep"),
     Adaptation::Initiate("Adaptation::Ecap::XactionRep"),
@@ -401,7 +401,7 @@ Adaptation::Ecap::XactionRep::useVirgin()
 
     preserveVb("useVirgin");
 
-    HttpMsg *clone = theVirginRep.raw().header->clone();
+    Http::Message *clone = theVirginRep.raw().header->clone();
     // check that clone() copies the pipe so that we do not have to
     Must(!theVirginRep.raw().header->body_pipe == !clone->body_pipe);
 
@@ -418,7 +418,7 @@ Adaptation::Ecap::XactionRep::useAdapted(const libecap::shared_ptr<libecap::Mess
     theAnswerRep = m;
     Must(proxyingAb == opUndecided);
 
-    HttpMsg *msg = answer().header;
+    Http::Message *msg = answer().header;
     updateSources(msg);
     if (!theAnswerRep->body()) { // final, bodyless answer
         proxyingAb = opNever;
@@ -457,7 +457,7 @@ Adaptation::Ecap::XactionRep::blockVirgin()
 /// Called just before sendAnswer() to record adapter meta-information
 /// which may affect answer processing and may be needed for logging.
 void
-Adaptation::Ecap::XactionRep::updateHistory(HttpMsg *adapted)
+Adaptation::Ecap::XactionRep::updateHistory(Http::Message *adapted)
 {
     if (!theMaster) // all updates rely on being able to query the adapter
         return;
@@ -734,8 +734,8 @@ Adaptation::Ecap::XactionRep::status() const
 }
 
 void
-Adaptation::Ecap::XactionRep::updateSources(HttpMsg *adapted)
+Adaptation::Ecap::XactionRep::updateSources(Http::Message *adapted)
 {
-    adapted->sources |= service().cfg().connectionEncryption ? HttpMsg::srcEcaps : HttpMsg::srcEcap;
+    adapted->sources |= service().cfg().connectionEncryption ? Http::Message::srcEcaps : Http::Message::srcEcap;
 }
 
index 481b42c17ea968a5b0d1fb42b9b23ce945d5e035..d6111d16c94883a4d6739596bfc642d94e44fbd7 100644 (file)
@@ -35,7 +35,7 @@ class XactionRep : public Adaptation::Initiate, public libecap::host::Xaction,
     CBDATA_CLASS(XactionRep);
 
 public:
-    XactionRep(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServicePointer &service);
+    XactionRep(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServicePointer &service);
     virtual ~XactionRep();
 
     typedef libecap::shared_ptr<libecap::adapter::Xaction> AdapterXaction;
@@ -91,10 +91,10 @@ protected:
 
     void moveAbContent();
 
-    void updateHistory(HttpMsg *adapted);
+    void updateHistory(Http::Message *adapted);
     void terminateMaster();
     void scheduleStop(const char *reason);
-    void updateSources(HttpMsg *adapted);
+    void updateSources(Http::Message *adapted);
 
     const libecap::Area clientIpValue() const;
     const libecap::Area usernameValue() const;
index 9aca3e39a2f29535c414fa92382e4a66233db63e..b7689068b18ce332fec8bf6be5740e0eb4ab09ca 100644 (file)
@@ -9,9 +9,7 @@
 #ifndef SQUID_ICAPINOUT_H
 #define SQUID_ICAPINOUT_H
 
-#include "HttpMsg.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 
 // IcapInOut manages a pointer to the HTTP message being worked on.
 // For HTTP responses, request header information is also available
@@ -27,7 +25,8 @@ class InOut
 {
 
 public:
-    typedef HttpMsg Header;
+    // TODO: s/Header/Message/i ?
+    typedef Http::Message Header;
 
     InOut(): header(0), cause(0) {}
 
@@ -64,8 +63,6 @@ public:
     BodyPipe::Pointer body_pipe;
 };
 
-// TODO: s/Header/Message/i ?
-
 } // namespace Icap
 } // namespace Adaptation
 
index a1cdde35e104d05e84dfbfa1086564c109fbca1c..4b9c51d213814a3f1c24c86d8c1af8a9979c0242 100644 (file)
@@ -17,9 +17,7 @@
 #include "adaptation/icap/Xaction.h"
 #include "base/TextException.h"
 #include "globals.h"
-#include "HttpMsg.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 
 Adaptation::Icap::Launcher::Launcher(const char *aTypeName,
                                      Adaptation::ServicePointer &aService):
index cbfc9ac41234218172603e112c551a616be7909e..9ed17fb7989f6041c8256f4ecc2f2db14ec97f1c 100644 (file)
@@ -27,9 +27,7 @@
 #include "err_detail_type.h"
 #include "http/one/TeChunkedParser.h"
 #include "HttpHeaderTools.h"
-#include "HttpMsg.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 #include "SquidTime.h"
 #include "URL.h"
 
@@ -49,7 +47,7 @@ Adaptation::Icap::ModXact::State::State()
     memset(this, 0, sizeof(*this));
 }
 
-Adaptation::Icap::ModXact::ModXact(HttpMsg *virginHeader,
+Adaptation::Icap::ModXact::ModXact(Http::Message *virginHeader,
                                    HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::Icap::ServiceRep::Pointer &aService):
     AsyncJob("Adaptation::Icap::ModXact"),
     Adaptation::Icap::Xaction("Adaptation::Icap::ModXact", aService),
@@ -777,9 +775,9 @@ void Adaptation::Icap::ModXact::startSending()
         echoMore();
     else {
         // If we are not using the virgin HTTP object update the
-        // HttpMsg::sources flag.
+        // Http::Message::sources flag.
         // The state.sending may set to State::sendingVirgin in the case
-        // of 206 responses too, where we do not want to update HttpMsg::sources
+        // of 206 responses too, where we do not want to update Http::Message::sources
         // flag. However even for 206 responses the state.sending is
         // not set yet to sendingVirgin. This is done in later step
         // after the parseBody method called.
@@ -953,12 +951,12 @@ void Adaptation::Icap::ModXact::prepEchoing()
     setOutcome(xoEcho);
 
     // We want to clone the HTTP message, but we do not want
-    // to copy some non-HTTP state parts that HttpMsg kids carry in them.
+    // to copy some non-HTTP state parts that Http::Message kids carry in them.
     // Thus, we cannot use a smart pointer, copy constructor, or equivalent.
     // Instead, we simply write the HTTP message and "clone" it by parsing.
-    // TODO: use HttpMsg::clone()!
+    // TODO: use Http::Message::clone()!
 
-    HttpMsg *oldHead = virgin.header;
+    Http::Message *oldHead = virgin.header;
     debugs(93, 7, HERE << "cloning virgin message " << oldHead);
 
     MemBuf httpBuf;
@@ -970,7 +968,7 @@ void Adaptation::Icap::ModXact::prepEchoing()
     // allocate the adapted message and copy metainfo
     Must(!adapted.header);
     {
-        HttpMsg::Pointer newHead;
+        Http::MessagePointer newHead;
         if (dynamic_cast<const HttpRequest*>(oldHead)) {
             newHead = new HttpRequest;
         } else if (dynamic_cast<const HttpReply*>(oldHead)) {
@@ -986,7 +984,7 @@ void Adaptation::Icap::ModXact::prepEchoing()
     // parse the buffer back
     Http::StatusCode error = Http::scNone;
 
-    httpBuf.terminate(); // HttpMsg::parse requires nil-terminated buffer
+    httpBuf.terminate(); // Http::Message::parse requires nil-terminated buffer
     Must(adapted.header->parse(httpBuf.content(), httpBuf.contentSize(), true, &error));
     Must(adapted.header->hdr_sz == httpBuf.contentSize()); // no leftovers
 
@@ -1094,7 +1092,7 @@ bool Adaptation::Icap::ModXact::parsePart(Part *part, const char *description)
     debugs(93, 5, "have " << readBuf.length() << ' ' << description << " bytes to parse; state: " << state.parsing);
     Http::StatusCode error = Http::scNone;
     // XXX: performance regression. c_str() data copies
-    // XXX: HttpMsg::parse requires a terminated string buffer
+    // XXX: Http::Message::parse requires a terminated string buffer
     const char *tmpBuf = readBuf.c_str();
     const bool parsed = part->parse(tmpBuf, readBuf.length(), commEof, &error);
     debugs(93, (!parsed && error) ? 2 : 5, description << " parsing result: " << parsed << " detail: " << error);
@@ -1105,7 +1103,8 @@ bool Adaptation::Icap::ModXact::parsePart(Part *part, const char *description)
 }
 
 // parses both HTTP and ICAP headers
-bool Adaptation::Icap::ModXact::parseHead(HttpMsg *head)
+bool
+Adaptation::Icap::ModXact::parseHead(Http::Message *head)
 {
     if (!parsePart(head, "head")) {
         head->reset();
@@ -1348,7 +1347,7 @@ void Adaptation::Icap::ModXact::finalizeLogInfo()
 #endif
     al.cache.code = h->logType;
 
-    const HttpMsg *virgin_msg = dynamic_cast<HttpReply*>(virgin.header);
+    const Http::Message *virgin_msg = dynamic_cast<HttpReply*>(virgin.header);
     if (!virgin_msg)
         virgin_msg = virgin_request_;
     assert(virgin_msg != virgin.cause);
@@ -1450,7 +1449,7 @@ void Adaptation::Icap::ModXact::makeRequestHeaders(MemBuf &buf)
     }
 
     if (ICAP::methodRespmod == m)
-        if (const HttpMsg *prime = virgin.header)
+        if (const Http::Message *prime = virgin.header)
             encapsulateHead(buf, "res-hdr", httpBuf, prime);
 
     if (!virginBody.expected())
@@ -1584,17 +1583,18 @@ void Adaptation::Icap::ModXact::makeUsernameHeader(const HttpRequest *request, M
 #endif
 }
 
-void Adaptation::Icap::ModXact::encapsulateHead(MemBuf &icapBuf, const char *section, MemBuf &httpBuf, const HttpMsg *head)
+void
+Adaptation::Icap::ModXact::encapsulateHead(MemBuf &icapBuf, const char *section, MemBuf &httpBuf, const Http::Message *head)
 {
     // update ICAP header
     icapBuf.appendf("%s=%d, ", section, (int) httpBuf.contentSize());
 
     // begin cloning
-    HttpMsg::Pointer headClone;
+    Http::MessagePointer headClone;
 
     if (const HttpRequest* old_request = dynamic_cast<const HttpRequest*>(head)) {
         HttpRequest::Pointer new_request(new HttpRequest);
-        // copy the requst-line details
+        // copy the request-line details
         new_request->method = old_request->method;
         new_request->url = old_request->url;
         new_request->http_ver = old_request->http_ver;
@@ -1624,7 +1624,8 @@ void Adaptation::Icap::ModXact::encapsulateHead(MemBuf &icapBuf, const char *sec
     // headClone unlocks and, hence, deletes the message we packed
 }
 
-void Adaptation::Icap::ModXact::packHead(MemBuf &httpBuf, const HttpMsg *head)
+void
+Adaptation::Icap::ModXact::packHead(MemBuf &httpBuf, const Http::Message *head)
 {
     head->packInto(&httpBuf, true);
 }
@@ -1819,7 +1820,7 @@ void Adaptation::Icap::ModXact::estimateVirginBody()
 {
     // note: lack of size info may disable previews and 204s
 
-    HttpMsg *msg = virgin.header;
+    Http::Message *msg = virgin.header;
     Must(msg);
 
     HttpRequestMethod method;
@@ -2014,12 +2015,12 @@ void Adaptation::Icap::ModXact::clearError()
 void Adaptation::Icap::ModXact::updateSources()
 {
     Must(adapted.header);
-    adapted.header->sources |= (service().cfg().connectionEncryption ? HttpMsg::srcIcaps : HttpMsg::srcIcap);
+    adapted.header->sources |= (service().cfg().connectionEncryption ? Http::Message::srcIcaps : Http::Message::srcIcap);
 }
 
 /* Adaptation::Icap::ModXactLauncher */
 
-Adaptation::Icap::ModXactLauncher::ModXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::ServicePointer aService):
+Adaptation::Icap::ModXactLauncher::ModXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::ServicePointer aService):
     AsyncJob("Adaptation::Icap::ModXactLauncher"),
     Adaptation::Icap::Launcher("Adaptation::Icap::ModXactLauncher", aService),
     al(alp)
index fdac7a0e980fae09610e5f67fb91f12c29f7c489..1fd220c348ab6bd0b24e3765f93defe129c145fc 100644 (file)
@@ -125,7 +125,7 @@ class ModXact: public Xaction, public BodyProducer, public BodyConsumer
     CBDATA_CLASS(ModXact);
 
 public:
-    ModXact(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, ServiceRep::Pointer &s);
+    ModXact(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, ServiceRep::Pointer &s);
     virtual ~ModXact();
 
     // BodyProducer methods
@@ -217,7 +217,7 @@ private:
     void parseHeaders();
     void parseIcapHead();
     void parseHttpHead();
-    bool parseHead(HttpMsg *head);
+    bool parseHead(Http::Message *head);
 
     void decideOnParsingBody();
     void parseBody();
@@ -239,7 +239,7 @@ private:
     void prepEchoing();
     void prepPartialBodyEchoing(uint64_t pos);
     void echoMore();
-    void updateSources(); ///< Update the HttpMsg sources
+    void updateSources(); ///< Update the Http::Message sources
 
     virtual bool doneAll() const;
     virtual void swanSong();
@@ -262,8 +262,8 @@ private:
     template<class Part>
     bool parsePart(Part *part, const char *description);
 
-    void packHead(MemBuf &httpBuf, const HttpMsg *head);
-    void encapsulateHead(MemBuf &icapBuf, const char *section, MemBuf &httpBuf, const HttpMsg *head);
+    void packHead(MemBuf &httpBuf, const Http::Message *head);
+    void encapsulateHead(MemBuf &icapBuf, const char *section, MemBuf &httpBuf, const Http::Message *head);
     bool gotEncapsulated(const char *section) const;
     /// whether ICAP response header indicates HTTP header presence
     bool expectHttpHeader() const;
@@ -359,7 +359,7 @@ class ModXactLauncher: public Launcher
     CBDATA_CLASS(ModXactLauncher);
 
 public:
-    ModXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::ServicePointer s);
+    ModXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, Adaptation::ServicePointer s);
 
 protected:
     virtual Xaction *createXaction();
index fcce63ee3b3a413813309998755f1531b3747287..7ea7465a717abbd6061e9bfdf7c4270379311858 100644 (file)
@@ -69,7 +69,7 @@ void Adaptation::Icap::OptXact::makeRequest(MemBuf &buf)
 
     // XXX: HttpRequest cannot fully parse ICAP Request-Line
     Http::StatusCode reqStatus;
-    buf.terminate(); // HttpMsg::parse requires terminated buffer
+    buf.terminate(); // Http::Message::parse requires terminated buffer
     Must(icapRequest->parse(buf.content(), buf.contentSize(), true, &reqStatus) > 0);
 }
 
index 192d4655cb8f2b9852309ca3cadc7a987d957ccf..d9fd5a83675ae2acad8135d3321634eb0d407f5f 100644 (file)
@@ -555,7 +555,7 @@ void Adaptation::Icap::ServiceRep::noteAdaptationAnswer(const Answer &answer)
     }
 
     Must(answer.kind == Answer::akForward); // no akBlock for OPTIONS requests
-    const HttpMsg *msg = answer.message.getRaw();
+    const Http::Message *msg = answer.message.getRaw();
     Must(msg);
 
     debugs(93,5, HERE << "is interpreting new options " << status());
@@ -677,7 +677,7 @@ Adaptation::Icap::ServiceRep::optionsFetchTime() const
 }
 
 Adaptation::Initiate *
-Adaptation::Icap::ServiceRep::makeXactLauncher(HttpMsg *virgin,
+Adaptation::Icap::ServiceRep::makeXactLauncher(Http::Message *virgin,
         HttpRequest *cause, AccessLogEntry::Pointer &alp)
 {
     return new Adaptation::Icap::ModXactLauncher(virgin, cause, alp, this);
index d08737cf6d501a0b8ef223de64dac1205ab3cc67..6906170137963e1baf8a59de60010cde02a326c9 100644 (file)
@@ -75,7 +75,7 @@ public:
     bool availableForNew() const; ///< a new transaction may start communicating with the service
     bool availableForOld() const; ///< a transaction notified about connection slot availability may start communicating with the service
 
-    virtual Initiate *makeXactLauncher(HttpMsg *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp);
+    virtual Initiate *makeXactLauncher(Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp);
 
     void callWhenAvailable(AsyncCall::Pointer &cb, bool priority = false);
     void callWhenReady(AsyncCall::Pointer &cb);
index cb9b4bfa409547f28e0a35043616518467a29e4e..cb154869986ef016c59c0d43e912a69a687450db 100644 (file)
@@ -24,9 +24,7 @@
 #include "fde.h"
 #include "FwdState.h"
 #include "globals.h"
-#include "HttpMsg.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 #include "icap_log.h"
 #include "ipcache.h"
 #include "pconn.h"
@@ -522,7 +520,8 @@ void Adaptation::Icap::Xaction::cancelRead()
     }
 }
 
-bool Adaptation::Icap::Xaction::parseHttpMsg(HttpMsg *msg)
+bool
+Adaptation::Icap::Xaction::parseHttpMsg(Http::Message *msg)
 {
     debugs(93, 5, "have " << readBuf.length() << " head bytes to parse");
 
index 73da61f953e6484feab1808418b2d14b786777ed..6a7e7fc61a9fe1f297303e9c6771301949c73ed3 100644 (file)
@@ -86,7 +86,7 @@ protected:
 
     void cancelRead();
 
-    bool parseHttpMsg(HttpMsg *msg); // true=success; false=needMore; throw=err
+    bool parseHttpMsg(Http::Message *msg); // true=success; false=needMore; throw=err
     bool mayReadMore() const;
 
     virtual bool doneReading() const;
index cbd59a6f73378b8ee0fa9b22cc261533a1236c5e..529e858711bf80a633b26150725ee9ea9bc858bc 100644 (file)
@@ -17,7 +17,6 @@
 #include "format/Format.h"
 #include "helper.h"
 #include "helper/Reply.h"
-#include "HttpMsg.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
 #include "rfc1738.h"
index 882173255a942085a090df3d003bb67e0bc21938..e2680e98b0fde08a33bcc6b4dd35b122fe2f15c3 100644 (file)
@@ -21,7 +21,6 @@
 #include "helper.h"
 #include "helper/Reply.h"
 #include "http/Stream.h"
-#include "HttpMsg.h"
 #include "HttpRequest.h"
 #include "MemBuf.h"
 #include "SquidTime.h"
index 6881e041ee416a9a6fcf4981d50a6a07ba09dbcc..4a52cf4870ec4f4523ffff59050d55046642166e 100644 (file)
@@ -1641,8 +1641,8 @@ clientProcessRequest(ConnStateData *conn, const Http1::RequestParserPointer &hp,
     // TODO: decouple http->flags.accel from request->flags.sslBumped
     request->flags.noDirect = (request->flags.accelerated && !request->flags.sslBumped) ?
                               !conn->port->allow_direct : 0;
-    request->sources |= isFtp ? HttpMsg::srcFtp :
-                        ((request->flags.sslBumped || conn->port->transport.protocol == AnyP::PROTO_HTTPS) ? HttpMsg::srcHttps : HttpMsg::srcHttp);
+    request->sources |= isFtp ? Http::Message::srcFtp :
+                        ((request->flags.sslBumped || conn->port->transport.protocol == AnyP::PROTO_HTTPS) ? Http::Message::srcHttps : Http::Message::srcHttp);
 #if USE_AUTH
     if (request->flags.sslBumped) {
         if (conn->getAuth() != NULL)
@@ -1695,7 +1695,7 @@ clientProcessRequest(ConnStateData *conn, const Http1::RequestParserPointer &hp,
     request->myportname = conn->port->name;
 
     if (!isFtp) {
-        // XXX: for non-HTTP messages instantiate a different HttpMsg child type
+        // XXX: for non-HTTP messages instantiate a different Http::Message child type
         // for now Squid only supports HTTP requests
         const AnyP::ProtocolVersion &http_ver = hp->messageProtocol();
         assert(request->http_ver.protocol == http_ver.protocol);
@@ -3430,7 +3430,7 @@ ConnStateData::buildFakeRequest(Http::MethodType const method, SBuf &useHost, un
         request->header.putStr(Http::HOST, useHost.c_str());
     request->flags.intercepted = ((clientConnection->flags & COMM_INTERCEPTION) != 0);
     request->flags.interceptTproxy = ((clientConnection->flags & COMM_TRANSPARENT) != 0 );
-    request->sources |= ((switchedToHttps() || port->transport.protocol == AnyP::PROTO_HTTPS) ? HttpMsg::srcHttps : HttpMsg::srcHttp);
+    request->sources |= ((switchedToHttps() || port->transport.protocol == AnyP::PROTO_HTTPS) ? Http::Message::srcHttps : Http::Message::srcHttp);
 #if USE_AUTH
     if (getAuth())
         request->auth_user_request = getAuth();
index 1d9f9b4530296525d00f9ee938a8fa7f12a995d1..d2940097fafa5345285e83e9888bcd64c83f42cf 100644 (file)
@@ -1883,7 +1883,7 @@ ClientHttpRequest::noteAdaptationAnswer(const Adaptation::Answer &answer)
 
     switch (answer.kind) {
     case Adaptation::Answer::akForward:
-        handleAdaptedHeader(const_cast<HttpMsg*>(answer.message.getRaw()));
+        handleAdaptedHeader(const_cast<Http::Message*>(answer.message.getRaw()));
         break;
 
     case Adaptation::Answer::akBlock:
@@ -1897,7 +1897,7 @@ ClientHttpRequest::noteAdaptationAnswer(const Adaptation::Answer &answer)
 }
 
 void
-ClientHttpRequest::handleAdaptedHeader(HttpMsg *msg)
+ClientHttpRequest::handleAdaptedHeader(Http::Message *msg)
 {
     assert(msg);
 
index df6462a6d295f7184ded516f2e480cbf732d29b9..c515ca7c3f09e4b94929b2930318512850a768f5 100644 (file)
@@ -13,6 +13,7 @@
 #include "acl/forward.h"
 #include "client_side.h"
 #include "clientStream.h"
+#include "http/forward.h"
 #include "HttpHeaderRange.h"
 #include "LogTags.h"
 #include "Store.h"
@@ -20,7 +21,6 @@
 #if USE_ADAPTATION
 #include "adaptation/forward.h"
 #include "adaptation/Initiator.h"
-class HttpMsg;
 #endif
 
 class ClientRequestContext;
@@ -168,7 +168,7 @@ private:
 
     // Adaptation::Initiator API
     virtual void noteAdaptationAnswer(const Adaptation::Answer &answer);
-    void handleAdaptedHeader(HttpMsg *msg);
+    void handleAdaptedHeader(Http::Message *msg);
     void handleAdaptationBlock(const Adaptation::Answer &answer);
     virtual void noteAdaptationAclCheckDone(Adaptation::ServiceGroupPointer group);
 
index 807ae3b3b31a996ad8a3cd13ab86c410a0d419bb..8706157252b89c885bb959dc0b1a5de0d33a4820 100644 (file)
@@ -464,7 +464,7 @@ sameUrlHosts(const char *url1, const char *url2)
 
 // purges entries that match the value of a given HTTP [response] header
 static void
-purgeEntriesByHeader(HttpRequest *req, const char *reqUrl, HttpMsg *rep, Http::HdrType hdr)
+purgeEntriesByHeader(HttpRequest *req, const char *reqUrl, Http::Message *rep, Http::HdrType hdr)
 {
     const char *hdrUrl, *absUrl;
 
@@ -681,7 +681,7 @@ Client::noteAdaptationAnswer(const Adaptation::Answer &answer)
 
     switch (answer.kind) {
     case Adaptation::Answer::akForward:
-        handleAdaptedHeader(const_cast<HttpMsg*>(answer.message.getRaw()));
+        handleAdaptedHeader(const_cast<Http::Message*>(answer.message.getRaw()));
         break;
 
     case Adaptation::Answer::akBlock:
@@ -695,7 +695,7 @@ Client::noteAdaptationAnswer(const Adaptation::Answer &answer)
 }
 
 void
-Client::handleAdaptedHeader(HttpMsg *msg)
+Client::handleAdaptedHeader(Http::Message *msg)
 {
     if (abortOnBadEntry("entry went bad while waiting for adapted headers")) {
         // If the adapted response has a body, the ICAP side needs to know
index 8bc7d51bfdefc6bac4f986acacd159c8be6657c6..89d538e643146e29b473ca08da4db01a00d5b10d 100644 (file)
 #include "BodyPipe.h"
 #include "CommCalls.h"
 #include "FwdState.h"
+#include "http/forward.h"
 #include "StoreIOBuffer.h"
 #if USE_ADAPTATION
 #include "adaptation/forward.h"
 #include "adaptation/Initiator.h"
 #endif
 
-class HttpMsg;
-class HttpReply;
-
 /**
  * Client is a common base for classes such as HttpStateData and FtpStateData.
  * All such classes must be able to consume request bodies from a BodyPipe
@@ -127,7 +125,7 @@ protected:
     void handleAdaptedBodyProductionEnded();
     void handleAdaptedBodyProducerAborted();
 
-    void handleAdaptedHeader(HttpMsg *msg);
+    void handleAdaptedHeader(Http::Message *msg);
     void handleAdaptationCompleted();
     void handleAdaptationBlocked(const Adaptation::Answer &answer);
     void handleAdaptationAborted(bool bypassable = false);
index 03ad932d9babc8fc729f98f7720d9d2ae0395859..da0d5d2a09014736870506f8d08fe96074cd6afa 100644 (file)
@@ -27,7 +27,6 @@
 #include "HttpHeader.h"
 #include "HttpHeaderRange.h"
 #include "HttpReply.h"
-#include "HttpRequest.h"
 #include "ip/tools.h"
 #include "MemBuf.h"
 #include "mime.h"
@@ -2616,7 +2615,7 @@ Ftp::Gateway::appendSuccessHeader()
     if (mime_enc)
         reply->header.putStr(Http::HdrType::CONTENT_ENCODING, mime_enc);
 
-    reply->sources |= HttpMsg::srcFtp;
+    reply->sources |= Http::Message::srcFtp;
     setVirginReply(reply);
     adaptOrFinalizeReply();
 }
index c702ad53ae15772cb69924b950079166e2d7367d..d97357c14d3e5587eb45de492745537153928b21 100644 (file)
@@ -377,7 +377,7 @@ Ftp::Relay::forwardReply()
     EBIT_CLR(entry->flags, ENTRY_FWD_HDR_WAIT);
 
     HttpReply *const reply = createHttpReply(Http::scNoContent);
-    reply->sources |= HttpMsg::srcFtp;
+    reply->sources |= Http::Message::srcFtp;
 
     setVirginReply(reply);
     adaptOrFinalizeReply();
@@ -450,7 +450,7 @@ Ftp::Relay::startDataDownload()
            " (" << data.conn->local << ")");
 
     HttpReply *const reply = createHttpReply(Http::scOkay, -1);
-    reply->sources |= HttpMsg::srcFtp;
+    reply->sources |= Http::Message::srcFtp;
 
     EBIT_CLR(entry->flags, ENTRY_FWD_HDR_WAIT);
     setVirginReply(reply);
index 8cf59dc37dcea0301be4e6abc7e59d93d453c81e..fb73afb0a64cd13c925aca2889e80fed23e6ec97 100644 (file)
@@ -335,10 +335,10 @@ sslErrorName(Security::ErrorCode err, char *buf, size_t size)
 /// \retval HttpReply sent to the HTTP client (access.log and default context).
 /// \retval HttpReply received (encapsulated) from the ICAP server (icap.log context).
 /// \retval HttpRequest received (encapsulated) from the ICAP server (icap.log context).
-static const HttpMsg *
+static const Http::Message *
 actualReplyHeader(const AccessLogEntry::Pointer &al)
 {
-    const HttpMsg *msg = al->reply;
+    const Http::Message *msg = al->reply;
 #if ICAP_CLIENT
     // al->icap.reqMethod is methodNone in access.log context
     if (!msg && al->icap.reqMethod == Adaptation::methodReqmod)
@@ -349,7 +349,7 @@ actualReplyHeader(const AccessLogEntry::Pointer &al)
 
 /// XXX: Misnamed. See actualReplyHeader().
 /// \return HttpRequest or HttpReply for %http::>h.
-static const HttpMsg *
+static const Http::Message *
 actualRequestHeader(const AccessLogEntry::Pointer &al)
 {
 #if ICAP_CLIENT
@@ -628,7 +628,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
             break;
 
         case LFT_REQUEST_HEADER:
-            if (const HttpMsg *msg = actualRequestHeader(al))
+            if (const Http::Message *msg = actualRequestHeader(al))
                 sb = msg->header.getByName(fmt->data.header.header);
 
             out = sb.termedBuf();
@@ -649,7 +649,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
             break;
 
         case LFT_REPLY_HEADER: {
-            if (const HttpMsg *msg = actualReplyHeader(al))
+            if (const Http::Message *msg = actualReplyHeader(al))
                 sb = msg->header.getByName(fmt->data.header.header);
 
             out = sb.termedBuf();
@@ -838,7 +838,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
             break;
 #endif
         case LFT_REQUEST_HEADER_ELEM:
-            if (const HttpMsg *msg = actualRequestHeader(al))
+            if (const Http::Message *msg = actualRequestHeader(al))
                 sb = msg->header.getByNameListMember(fmt->data.header.header, fmt->data.header.element, fmt->data.header.separator);
 
             out = sb.termedBuf();
@@ -858,7 +858,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
             break;
 
         case LFT_REPLY_HEADER_ELEM: {
-            if (const HttpMsg *msg = actualReplyHeader(al))
+            if (const Http::Message *msg = actualReplyHeader(al))
                 sb = msg->header.getByNameListMember(fmt->data.header.header, fmt->data.header.element, fmt->data.header.separator);
 
             out = sb.termedBuf();
index e966c889ec2bbc47ef26853cbaf6861ff2fb3814..f3220864724a849467c94223da2441ffac38a878 100644 (file)
@@ -15,7 +15,7 @@
 #include "sbuf/SBuf.h"
 
 // FTP does not have a notion of a "protocol version" but we need something for
-// compatibility with the current HttpMsg wrapping layer. We use version 1.1:
+// compatibility with the current Http::Message wrapping layer. We use version 1.1:
 // * some ICAP services probably expect /1.0 or /1.1 when parsing HTTP headers;
 // * FTP commands are sent on a "persistent by default" connection, just like
 //   HTTP/1.1. Using 1.1 leads to fewer exceptions in current code shared by
index cf8e989a69d041ab8f022ab18ae1f5ca1c5f718d..bee2daedc8cf6f10f6f7be2c3223a06661bec9a0 100644 (file)
@@ -9,11 +9,10 @@
 #ifndef SQUID_FTP_ELEMENTS_H
 #define SQUID_FTP_ELEMENTS_H
 
+#include "http/forward.h"
 #include "http/StatusCode.h"
 #include "sbuf/forward.h"
 
-class HttpReply;
-
 namespace AnyP
 {
 class ProtocolVersion;
@@ -22,7 +21,7 @@ class ProtocolVersion;
 namespace Ftp
 {
 
-/// Protocol version to use in HttpMsg structures wrapping FTP messages.
+/// Protocol version to use in Http::Message structures wrapping FTP messages.
 AnyP::ProtocolVersion ProtocolVersion();
 
 /// Create an internal HttpReply structure to house FTP control response info.
index 9064f1719ce30feece29e8ba34550492e1ca5d95..fee738228cdc3ccc7ddcc67099872b13fb6c5071 100644 (file)
@@ -777,7 +777,7 @@ gopherReadReply(const Comm::ConnectionPointer &conn, char *buf, size_t len, Comm
         if (req->hier.bodyBytesRead < 0) {
             req->hier.bodyBytesRead = 0;
             // first bytes read, update Reply flags:
-            gopherState->reply_->sources |= HttpMsg::srcGopher;
+            gopherState->reply_->sources |= Http::Message::srcGopher;
         }
 
         req->hier.bodyBytesRead += len;
index ce24c6486bbffb0494d5d7ba08bc43dcc44981e3..5f31f9afe4f60d8961d648daa628b6d52be12146 100644 (file)
@@ -771,7 +771,7 @@ HttpStateData::processReplyHeader()
     // done with Parser, now process using the HttpReply
     hp = NULL;
 
-    newrep->sources |= request->url.getScheme() == AnyP::PROTO_HTTPS ? HttpMsg::srcHttps : HttpMsg::srcHttp;
+    newrep->sources |= request->url.getScheme() == AnyP::PROTO_HTTPS ? Http::Message::srcHttps : Http::Message::srcHttp;
 
     newrep->removeStaleWarnings();
 
index 72499fd23e7fa422887ccc6edd50014eb0b9a476..0527a13d7f0ceebc54783e924da2fd01b5152675 100644 (file)
@@ -17,6 +17,8 @@ libhttp_la_SOURCES = \
        ContentLengthInterpreter.cc \
        ContentLengthInterpreter.h \
        forward.h \
+       Message.cc \
+       Message.h \
        MethodType.cc \
        MethodType.h \
        ProtocolVersion.h \
similarity index 80%
rename from src/HttpMsg.cc
rename to src/http/Message.cc
index f6f2f8d8196db216dcbfaa0404133cc5c6b45b8a..4ba0c98d66e9d375bf9674a0b1ef48005c5f9d75 100644 (file)
 
 #include "squid.h"
 #include "Debug.h"
+#include "http/Message.h"
 #include "http/one/Parser.h"
 #include "HttpHdrCc.h"
 #include "HttpHeaderTools.h"
-#include "HttpMsg.h"
 #include "MemBuf.h"
 #include "mime_header.h"
 #include "profiler/Profiler.h"
 #include "SquidConfig.h"
 
-HttpMsg::HttpMsg(http_hdr_owner_type owner):
+Http::Message::Message(http_hdr_owner_type owner):
     http_ver(Http::ProtocolVersion()),
-    header(owner),
-    cache_control(NULL),
-    hdr_sz(0),
-    content_length(0),
-    pstate(psReadyToParseStartLine),
-    sources(0)
+    header(owner)
 {}
 
-HttpMsg::~HttpMsg()
+Http::Message::~Message()
 {
     assert(!body_pipe);
 }
 
 void
-HttpMsg::putCc(const HttpHdrCc *otherCc)
+Http::Message::putCc(const HttpHdrCc *otherCc)
 {
     // get rid of the old CC, if any
     if (cache_control) {
@@ -88,7 +83,7 @@ httpMsgIsolateStart(const char **parse_start, const char **blk_start, const char
 // zero return means need more data
 // positive return is the size of parsed headers
 bool
-HttpMsg::parse(const char *buf, const size_t sz, bool eof, Http::StatusCode *error)
+Http::Message::parse(const char *buf, const size_t sz, bool eof, Http::StatusCode *error)
 {
     assert(error);
     *error = Http::scNone;
@@ -107,13 +102,13 @@ HttpMsg::parse(const char *buf, const size_t sz, bool eof, Http::StatusCode *err
     }
 
     if (hdr_len > Config.maxReplyHeaderSize || (hdr_len <= 0 && sz > Config.maxReplyHeaderSize)) {
-        debugs(58, DBG_IMPORTANT, "HttpMsg::parse: Too large reply header (" << hdr_len << " > " << Config.maxReplyHeaderSize);
+        debugs(58, DBG_IMPORTANT, "Too large reply header (" << hdr_len << " > " << Config.maxReplyHeaderSize);
         *error = Http::scHeaderTooLarge;
         return false;
     }
 
     if (hdr_len <= 0) {
-        debugs(58, 3, "HttpMsg::parse: failed to find end of headers (eof: " << eof << ") in '" << buf << "'");
+        debugs(58, 3, "failed to find end of headers (eof: " << eof << ") in '" << buf << "'");
 
         if (eof) // iff we have seen the end, this is an error
             *error = Http::scInvalidHeader;
@@ -124,22 +119,22 @@ HttpMsg::parse(const char *buf, const size_t sz, bool eof, Http::StatusCode *err
     const int res = httpMsgParseStep(buf, sz, eof);
 
     if (res < 0) { // error
-        debugs(58, 3, "HttpMsg::parse: cannot parse isolated headers in '" << buf << "'");
+        debugs(58, 3, "cannot parse isolated headers in '" << buf << "'");
         *error = Http::scInvalidHeader;
         return false;
     }
 
     if (res == 0) {
-        debugs(58, 2, "HttpMsg::parse: strange, need more data near '" << buf << "'");
+        debugs(58, 2, "strange, need more data near '" << buf << "'");
         *error = Http::scInvalidHeader;
         return false; // but this should not happen due to headersEnd() above
     }
 
     assert(res > 0);
-    debugs(58, 9, "HttpMsg::parse success (" << hdr_len << " bytes) near '" << buf << "'");
+    debugs(58, 9, "success (" << hdr_len << " bytes) near '" << buf << "'");
 
     if (hdr_sz != (int)hdr_len) {
-        debugs(58, DBG_IMPORTANT, "internal HttpMsg::parse vs. headersEnd error: " <<
+        debugs(58, DBG_IMPORTANT, "internal Http::Message::parse vs. headersEnd error: " <<
                hdr_sz << " != " << hdr_len);
         hdr_sz = (int)hdr_len; // because old http.cc code used hdr_len
     }
@@ -147,16 +142,16 @@ HttpMsg::parse(const char *buf, const size_t sz, bool eof, Http::StatusCode *err
     return true;
 }
 
-/*
+/**
  * parseCharBuf() takes character buffer of HTTP headers (buf),
- * which may not be NULL-terminated, and fills in an HttpMsg
+ * which may not be NULL-terminated, and fills in an Http::Message
  * structure.  The parameter 'end' specifies the offset to
  * the end of the reply headers.  The caller may know where the
  * end is, but is unable to NULL-terminate the buffer.  This function
  * returns true on success.
  */
 bool
-HttpMsg::parseCharBuf(const char *buf, ssize_t end)
+Http::Message::parseCharBuf(const char *buf, ssize_t end)
 {
     MemBuf mb;
     int success;
@@ -170,15 +165,15 @@ HttpMsg::parseCharBuf(const char *buf, ssize_t end)
     return success == 1;
 }
 
-/*
- * parses a 0-terminating buffer into HttpMsg.
- * Returns:
- *      1 -- success
- *       0 -- need more data (partial parse)
- *      -1 -- parse error
+/**
+ * parses a 0-terminated buffer into Http::Message.
+ *
+ * \retval  1 success
+ * \retval  0 need more data (partial parse)
+ * \retval -1 parse error
  */
 int
-HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd)
+Http::Message::httpMsgParseStep(const char *buf, int len, int atEnd)
 {
     const char *parse_start = buf;
     int parse_len = len;
@@ -232,7 +227,7 @@ HttpMsg::httpMsgParseStep(const char *buf, int len, int atEnd)
 }
 
 bool
-HttpMsg::parseHeader(Http1::Parser &hp)
+Http::Message::parseHeader(Http1::Parser &hp)
 {
     // HTTP/1 message contains "zero or more header fields"
     // zero does not need parsing
@@ -251,14 +246,14 @@ HttpMsg::parseHeader(Http1::Parser &hp)
 
 /* handy: resets and returns -1 */
 int
-HttpMsg::httpMsgParseError()
+Http::Message::httpMsgParseError()
 {
     reset();
     return -1;
 }
 
 void
-HttpMsg::setContentLength(int64_t clen)
+Http::Message::setContentLength(int64_t clen)
 {
     header.delById(Http::HdrType::CONTENT_LENGTH); // if any
     header.putInt64(Http::HdrType::CONTENT_LENGTH, clen);
@@ -266,7 +261,7 @@ HttpMsg::setContentLength(int64_t clen)
 }
 
 bool
-HttpMsg::persistent() const
+Http::Message::persistent() const
 {
     if (http_ver > Http::ProtocolVersion(1,0)) {
         /*
@@ -280,24 +275,25 @@ HttpMsg::persistent() const
     }
 }
 
-void HttpMsg::packInto(Packable *p, bool full_uri) const
+void
+Http::Message::packInto(Packable *p, bool full_uri) const
 {
     packFirstLineInto(p, full_uri);
     header.packInto(p);
     p->append("\r\n", 2);
 }
 
-void HttpMsg::hdrCacheInit()
+void
+Http::Message::hdrCacheInit()
 {
     content_length = header.getInt64(Http::HdrType::CONTENT_LENGTH);
     assert(NULL == cache_control);
     cache_control = header.getCc();
 }
 
-/*
- * useful for debugging
- */
-void HttpMsg::firstLineBuf(MemBuf& mb)
+/// useful for debugging
+void
+Http::Message::firstLineBuf(MemBuf &mb)
 {
     packFirstLineInto(&mb, true);
 }
similarity index 84%
rename from src/HttpMsg.h
rename to src/http/Message.h
index 629b4259f416d0cb51f157aa94a6017e38f38ca7..6c4d1a2d0fa6afac0c7c6dc3a62a98f7f3ef0e99 100644 (file)
@@ -6,8 +6,8 @@
  * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
-#ifndef SQUID_HTTPMSG_H
-#define SQUID_HTTPMSG_H
+#ifndef SQUID_HTTP_MESSAGE_H
+#define SQUID_HTTP_MESSAGE_H
 
 #include "base/Lock.h"
 #include "BodyPipe.h"
 #include "http/StatusCode.h"
 #include "HttpHeader.h"
 
-/// common parts of HttpRequest and HttpReply
-class HttpMsg : public RefCountable
+namespace Http
 {
 
+/// common parts of HttpRequest and HttpReply
+class Message : public RefCountable
+{
 public:
-    typedef RefCount<HttpMsg> Pointer;
     /// Who may have created or modified this message?
     enum Sources {
         srcUnknown = 0,
@@ -44,18 +45,18 @@ public:
         srcSafe = 0x0000FFFF ///< Safe sources mask
     };
 
-    HttpMsg(http_hdr_owner_type owner);
-    virtual ~HttpMsg();
+    Message(http_hdr_owner_type);
+    virtual ~Message();
 
     virtual void reset() = 0; // will have body when http*Clean()s are gone
 
-    void packInto(Packable * p, bool full_uri) const;
+    void packInto(Packable *, bool full_uri) const;
 
     ///< produce a message copy, except for a few connection-specific settings
-    virtual HttpMsg *clone() const = 0; ///< \todo rename: not a true copy?
+    virtual Http::Message *clone() const = 0; // TODO rename: not a true copy?
 
     /// [re]sets Content-Length header and cached value
-    void setContentLength(int64_t clen);
+    void setContentLength(int64_t);
 
     /**
      * \retval true  the message sender asks to keep the connection open.
@@ -72,20 +73,22 @@ public:
 
     HttpHeader header;
 
-    HttpHdrCc *cache_control;
+    HttpHdrCc *cache_control = nullptr;
 
     /* Unsupported, writable, may disappear/change in the future
      * For replies, sums _stored_ status-line, headers, and <CRLF>.
      * Also used to report parsed header size if parse() is successful */
-    int hdr_sz;
+    int hdr_sz = 0;
 
-    int64_t content_length;
+    int64_t content_length = 0;
 
-    HttpMsgParseState pstate;   /* the current parsing state */
+    /// the current parsing state
+    HttpMsgParseState pstate = psReadyToParseStartLine;
 
-    BodyPipe::Pointer body_pipe; // optional pipeline to receive message body
+    /// optional pipeline to receive message body
+    BodyPipe::Pointer body_pipe;
 
-    uint32_t sources; ///< The message sources
+    uint32_t sources = 0; ///< The message sources
 
     /// copies Cache-Control header to this message
     void putCc(const HttpHdrCc *otherCc);
@@ -108,7 +111,7 @@ public:
 
     void firstLineBuf(MemBuf&);
 
-    virtual bool inheritProperties(const HttpMsg *aMsg) = 0;
+    virtual bool inheritProperties(const Http::Message *) = 0;
 
 protected:
     /**
@@ -127,6 +130,8 @@ protected:
     virtual void hdrCacheInit();
 };
 
+} // namespace Http
+
 #define HTTPMSGUNLOCK(a) if (a) { if ((a)->unlock() == 0) delete (a); (a)=NULL; }
 #define HTTPMSGLOCK(a) (a)->lock()
 
index 74a11aa3abf4497fbb0b45b6a89c0aa32e5243c0..892d393bb990f6415d1f3ba26497773e7d9e926b 100644 (file)
@@ -76,7 +76,7 @@ Http::StatusLine::parse(const String &protoPrefix, const char *start, const char
 {
     status_ = Http::scInvalidHeader;    /* Squid header parsing error */
 
-    // XXX: HttpMsg::parse() has a similar check but is using
+    // XXX: Http::Message::parse() has a similar check but is using
     // casesensitive comparison (which is required by HTTP errata?)
 
     if (protoPrefix.cmp("ICY", 3) == 0) {
index a322472c7f0686536258badecb0fbb360b78e620..7f5e9a643a6129e0a5913a7150b71fdadb877868 100644 (file)
@@ -14,6 +14,9 @@
 namespace Http
 {
 
+class Message;
+typedef RefCount<Http::Message> MessagePointer;
+
 class Stream;
 typedef RefCount<Http::Stream> StreamPointer;
 
index 202e964df4490ff08167c914fbfa78fed51e37ec..39d815607a757c948a5c1d3c1fd5bd3c3c80fb7b 100644 (file)
 #define STUB_API "HttpReply.cc"
 #include "tests/STUB.h"
 
-HttpReply::HttpReply() : HttpMsg(hoReply), date (0), last_modified (0),
+HttpReply::HttpReply() : Http::Message(hoReply), date (0), last_modified (0),
     expires (0), surrogate_control (NULL), content_range (NULL), keep_alive (0),
     protoPrefix("HTTP/"), do_clean(false), bodySizeMax(-2)
-    STUB_NOP
+    {STUB_NOP}
     HttpReply::~HttpReply() STUB
     void HttpReply::setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires_) STUB
     void HttpReply::packHeadersInto(Packable *) const STUB
@@ -27,7 +27,7 @@ HttpReply::HttpReply() : HttpMsg(hoReply), date (0), last_modified (0),
     bool HttpReply::parseFirstLine(const char *start, const char *end) STUB_RETVAL(false)
     void HttpReply::hdrCacheInit() STUB
     HttpReply * HttpReply::clone() const STUB_RETVAL(NULL)
-    bool HttpReply::inheritProperties(const HttpMsg *aMsg) STUB_RETVAL(false)
+    bool HttpReply::inheritProperties(const Http::Message *aMsg) STUB_RETVAL(false)
     bool HttpReply::updateOnNotModified(HttpReply const*) STUB_RETVAL(false)
     int64_t HttpReply::bodySize(const HttpRequestMethod&) const STUB_RETVAL(0)
 
index 1afc08c247af80ad259889441d45c77821b0783c..44ab6cc553bf368137fdcac81761d68a1d92d185 100644 (file)
@@ -15,8 +15,8 @@
 
 // void httpRequestPack(void *obj, Packable *p);
 
-HttpRequest::HttpRequest() : HttpMsg(hoRequest) {STUB}
-HttpRequest::HttpRequest(const HttpRequestMethod &, AnyP::ProtocolType, const char *, const char *) : HttpMsg(hoRequest) {STUB}
+HttpRequest::HttpRequest() : Http::Message(hoRequest) {STUB}
+HttpRequest::HttpRequest(const HttpRequestMethod &, AnyP::ProtocolType, const char *, const char *) : Http::Message(hoRequest) {STUB}
 HttpRequest::~HttpRequest() STUB
 void HttpRequest::reset() STUB
 void HttpRequest::initHTTP(const HttpRequestMethod &, AnyP::ProtocolType, const char *, const char *) STUB
@@ -55,6 +55,6 @@ int64_t HttpRequest::getRangeOffsetLimit() STUB_RETVAL(0)
 void HttpRequest::packFirstLineInto(Packable *, bool) const STUB
 bool HttpRequest::sanityCheckStartLine(const char *, const size_t, Http::StatusCode *) STUB_RETVAL(false)
 void HttpRequest::hdrCacheInit() STUB
-bool HttpRequest::inheritProperties(const HttpMsg *) STUB_RETVAL(false)
+bool HttpRequest::inheritProperties(const Http::Message *) STUB_RETVAL(false)
 NotePairs::Pointer HttpRequest::notes() STUB_RETVAL(NotePairs::Pointer())
 
index 8822400107d3bfe342cad2f4b8585e3362af136c..4cbf7e92efcfdc7413f58005b951613bf6c3cd1a 100644 (file)
@@ -487,7 +487,7 @@ TunnelStateData::handleConnectResponse(const size_t chunkSize)
     HttpReply rep;
     Http::StatusCode parseErr = Http::scNone;
     const bool eof = !chunkSize;
-    connectRespBuf->terminate(); // HttpMsg::parse requires terminated string
+    connectRespBuf->terminate(); // Http::Message::parse requires terminated string
     const bool parsed = rep.parse(connectRespBuf->content(), connectRespBuf->contentSize(), eof, &parseErr);
     if (!parsed) {
         if (parseErr > 0) { // unrecoverable parsing error
@@ -1170,7 +1170,7 @@ tunnelRelayConnectRequest(const Comm::ConnectionPointer &srv, void *data)
     tunnelState->connectRespBuf = new MemBuf;
     // SQUID_TCP_SO_RCVBUF: we should not accumulate more than regular I/O buffer
     // can hold since any CONNECT response leftovers have to fit into server.buf.
-    // 2*SQUID_TCP_SO_RCVBUF: HttpMsg::parse() zero-terminates, which uses space.
+    // 2*SQUID_TCP_SO_RCVBUF: Http::Message::parse() zero-terminates, which uses space.
     tunnelState->connectRespBuf->init(SQUID_TCP_SO_RCVBUF, 2*SQUID_TCP_SO_RCVBUF);
     tunnelState->readConnectResponse();
 
index 823c695c343a3b7ebcfec3773cbae7f2a42e4ea7..0523573127158aa57f724e88c07deb0009fff224 100644 (file)
@@ -105,7 +105,7 @@ WhoisState::setReplyToOK(StoreEntry *sentry)
     HttpReply *reply = new HttpReply;
     sentry->buffer();
     reply->setHeaders(Http::scOkay, "Gatewaying", "text/plain", -1, -1, -2);
-    reply->sources |= HttpMsg::srcWhois;
+    reply->sources |= Http::Message::srcWhois;
     sentry->replaceHttpReply(reply);
 }