]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Implemented HttpHdrCc::MAX_AGE_UNSET constant and used it instead of mask
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 21 Sep 2011 07:32:21 +0000 (09:32 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 21 Sep 2011 07:32:21 +0000 (09:32 +0200)
src/HttpHdrCc.cc
src/HttpHdrCc.h

index dd30b593dcbbafce58407d41d53b2d1a931c934c..ff96e70c9a7d1f826eb2de8b4b2cdc78ade8193d 100644 (file)
@@ -167,7 +167,7 @@ HttpHdrCc::parse(const String & str)
             int32_t ma;
             if (!p || !httpHeaderParseInt(p, &ma)) {
                 debugs(65, 2, "cc: invalid max-age specs near '" << item << "'");
-                cc->setMaxAge(-1);
+                cc->setMaxAge(MAX_AGE_UNSET);
             } else {
                 cc->setMaxAge(ma);
             }
@@ -274,7 +274,7 @@ HttpHdrCc::setMaxAge(int max_age_)
         max_age = max_age_;
     } else {
         EBIT_CLR(mask, CC_MAX_AGE);
-        max_age=-1;
+        max_age=MAX_AGE_UNSET;
     }
 }
 
index b0571e1115cca5a254d40250f92bf80bea39ecf3..09b0fd190d9f20f0e17c2a433d7ee1a299a132eb 100644 (file)
@@ -44,15 +44,19 @@ class HttpHdrCc
 {
 
 public:
+       static const int32_t MAX_AGE_UNSET=-1; //max-age is unset
+
     explicit HttpHdrCc() :
-            mask(0), max_age(-1), s_maxage(-1),
+            mask(0), max_age(MAX_AGE_UNSET), s_maxage(-1),
             max_stale(-1), stale_if_error(0),
             min_fresh(-1) {}
 
     void clear();
     bool parse(const String & s);
+
     void setMaxAge(int32_t max_age);
     int32_t getMaxAge() const;
+
     MEMPROXY_CLASS(HttpHdrCc);
 
     int32_t mask;