/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
virtual bool inheritProperties(const HttpMsg *aMsg);
- void updateOnNotModified(HttpReply const *other);
+ bool updateOnNotModified(HttpReply const *other);
/** set commonly used info with one call */
void setHeaders(Http::StatusCode status,
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;
int validatorsMatch (HttpReply const *other) const;
- void packHeadersInto(Packer * p) const;
+ void packHeadersInto(Packable * p) const;
/** Clone this reply.
* Could be done as a copy-contructor but we do not want to accidently copy a HttpReply..
virtual void hdrCacheInit();
+ /// whether our Date header value is smaller than theirs
+ /// \returns false if any information is missing
+ bool olderThan(const HttpReply *them) const;
+
private:
/** initialize */
void init();
void hdrCacheClean();
- void packInto(Packer * 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();
mutable int64_t bodySizeMax; /**< cached result of calcMaxBodySize */
protected:
- virtual void packFirstLineInto(Packer * p, bool) const { sline.packInto(p); }
+ virtual void packFirstLineInto(Packable * p, bool) const { sline.packInto(p); }
virtual bool parseFirstLine(const char *start, const char *end);
};