From: Alex Rousskov Date: Fri, 11 Mar 2016 17:48:57 +0000 (-0700) Subject: Added missing const qualifiers to HTTP message packing methods. X-Git-Tag: SQUID_4_0_8~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f28a150c09c2a2aa3a029439532e6c96d7c3f83;p=thirdparty%2Fsquid.git Added missing const qualifiers to HTTP message packing methods. --- diff --git a/src/HttpReply.cc b/src/HttpReply.cc index f2409cac49..eed1d1de79 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -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 diff --git a/src/HttpReply.h b/src/HttpReply.h index e178496119..55e9de2239 100644 --- a/src/HttpReply.h +++ b/src/HttpReply.h @@ -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(); diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 272ed0ebd0..9f61778237 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -351,7 +351,7 @@ HttpRequest::swapOut(StoreEntry * e) /* packs request-line and headers, appends terminator */ void -HttpRequest::pack(Packable * p) +HttpRequest::pack(Packable * p) const { assert(p); /* pack request-line */ diff --git a/src/HttpRequest.h b/src/HttpRequest.h index d8a1526306..d197e1e5fc 100644 --- a/src/HttpRequest.h +++ b/src/HttpRequest.h @@ -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); diff --git a/src/tests/stub_HttpRequest.cc b/src/tests/stub_HttpRequest.cc index 616a0ea0a2..70cc689f68 100644 --- a/src/tests/stub_HttpRequest.cc +++ b/src/tests/stub_HttpRequest.cc @@ -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)