]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added missing const qualifiers to HTTP message packing methods.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 11 Mar 2016 17:48:57 +0000 (10:48 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 11 Mar 2016 17:48:57 +0000 (10:48 -0700)
src/HttpReply.cc
src/HttpReply.h
src/HttpRequest.cc
src/HttpRequest.h
src/tests/stub_HttpRequest.cc

index f2409cac49b7513ed212cbcbd267e9a0c9b579fc..eed1d1de798f693824d879f2eacf62d6e3fdb071 100644 (file)
@@ -116,7 +116,7 @@ HttpReply::packHeadersInto(Packable * p) const
 }
 
 void
-HttpReply::packInto(Packable * p)
+HttpReply::packInto(Packable * p) const
 {
     packHeadersInto(p);
     body.packInto(p);
@@ -124,7 +124,7 @@ HttpReply::packInto(Packable * p)
 
 /* create memBuf, create mem-based packer, pack, destroy packer, return MemBuf */
 MemBuf *
-HttpReply::pack()
+HttpReply::pack() const
 {
     MemBuf *mb = new MemBuf;
     mb->init();
@@ -161,7 +161,7 @@ HttpReply::make304() const
 }
 
 MemBuf *
-HttpReply::packed304Reply()
+HttpReply::packed304Reply() const
 {
     /* Not as efficient as skipping the header duplication,
      * but easier to maintain
index e17849611921d9896c9afd22d8e502ea174513e6..55e9de2239b462336b300f6d787fadbe64f28c91 100644 (file)
@@ -79,7 +79,7 @@ public:
                     const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires);
 
     /** \return a ready to use mem buffer with a packed reply */
-    MemBuf *pack();
+    MemBuf *pack() const;
 
     /** construct a 304 reply and return it */
     HttpReply *make304() const;
@@ -120,11 +120,11 @@ private:
 
     void hdrCacheClean();
 
-    void packInto(Packable * p);
+    void packInto(Packable * p) const;
 
     /* ez-routines */
     /** \return construct 304 reply and pack it into a MemBuf */
-    MemBuf *packed304Reply();
+    MemBuf *packed304Reply() const;
 
     /* header manipulation */
     time_t hdrExpirationTime();
index 272ed0ebd0b06a6981100a0ba96b8f56f09af48b..9f61778237dc3403a977cdbbe2ed755cf9e43282 100644 (file)
@@ -351,7 +351,7 @@ HttpRequest::swapOut(StoreEntry * e)
 
 /* packs request-line and headers, appends <crlf> terminator */
 void
-HttpRequest::pack(Packable * p)
+HttpRequest::pack(Packable * p) const
 {
     assert(p);
     /* pack request-line */
index d8a15263065eea7c6ad31fd1cc465270c09d8b54..d197e1e5fccb1b3170d2f3ee532ed57bd4889816 100644 (file)
@@ -189,7 +189,7 @@ public:
 
     void swapOut(StoreEntry * e);
 
-    void pack(Packable * p);
+    void pack(Packable * p) const;
 
     static void httpRequestPack(void *obj, Packable *p);
 
index 616a0ea0a2c186419b67194257a20fa94e3c3baa..70cc689f687ba83027c526a349a619c53c619852 100644 (file)
@@ -45,7 +45,7 @@ bool HttpRequest::expectingBody(const HttpRequestMethod &, int64_t &) const STUB
 bool HttpRequest::bodyNibbled() const STUB_RETVAL(false)
 int HttpRequest::prefixLen() const STUB_RETVAL(0)
 void HttpRequest::swapOut(StoreEntry *) STUB
-void HttpRequest::pack(Packable *) STUB
+void HttpRequest::pack(Packable *) const STUB
 void HttpRequest::httpRequestPack(void *, Packable *) STUB
 HttpRequest * HttpRequest::CreateFromUrlAndMethod(char *, const HttpRequestMethod &) STUB_RETVAL(NULL)
 HttpRequest * HttpRequest::CreateFromUrl(char *) STUB_RETVAL(NULL)