]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ICAP/ICAPOptions.cc
- ICAP-unrelated improvements from the squid3-icap branch on SF
[thirdparty/squid.git] / src / ICAP / ICAPOptions.cc
index 41cffef5876bb94df3118cf54d1f472d2d30b8c7..c28abaec70e2eb68a1d75653d5549e5b0996a6b2 100644 (file)
@@ -57,10 +57,16 @@ bool ICAPOptions::fresh() const
     return squid_curtime <= expire();
 }
 
+int ICAPOptions::ttl() const
+{
+    Must(valid());
+    return theTTL >= 0 ? theTTL : TheICAPConfig.default_options_ttl;
+}
+
 time_t ICAPOptions::expire() const
 {
     Must(valid());
-    return theTTL >= 0 ? theTimestamp + theTTL : -1;
+    return theTimestamp + ttl();
 }
 
 void ICAPOptions::configure(const HttpReply *reply)
@@ -92,9 +98,6 @@ void ICAPOptions::configure(const HttpReply *reply)
 
     cfgIntHeader(h, "Options-TTL", theTTL);
 
-    if (theTTL < 0)
-        theTTL = TheICAPConfig.default_options_ttl;
-
     theTimestamp = h->getTime(HDR_DATE);
 
     if (theTimestamp < 0)