]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added a default ICAP Options-TTL setting.
authorwessels <>
Wed, 14 Dec 2005 05:17:02 +0000 (05:17 +0000)
committerwessels <>
Wed, 14 Dec 2005 05:17:02 +0000 (05:17 +0000)
src/ICAP/ICAPConfig.h
src/ICAP/ICAPOptions.cc
src/cf.data.pre

index 0b95ee8742fa637e6e2b7cf2b01319e0ea431ecf..affa9910604256637cc6d6184e3289c36994ebe3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICAPConfig.h,v 1.5 2005/12/01 23:24:00 wessels Exp $
+ * $Id: ICAPConfig.h,v 1.6 2005/12/13 22:17:03 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -94,6 +94,7 @@ public:
     int onoff;
     int preview_enable;
     int preview_size;
+    int default_options_ttl;
     int send_client_ip;
     int send_client_username;
     int reuse_connections;
index 9b96d33d729ff3b5f2e645c5ee475f6bd96209a0..a779114c63f9f98b857dc120bc22d98df51ed7cd 100644 (file)
@@ -2,6 +2,9 @@
 #include "HttpReply.h"
 #include "ICAPOptions.h"
 #include "TextException.h"
+#include "ICAPConfig.h"
+
+extern ICAPConfig TheICAPConfig;
 
 ICAPOptions::ICAPOptions(): error("unconfigured"), method(ICAP::methodNone),
         max_connections(-1), allow204(false),
@@ -150,6 +153,9 @@ void ICAPOptions::configure(const HttpReply *reply)
 
     cfgIntHeader(h, "Options-TTL", theTTL);
 
+    if (theTTL < 0)
+        theTTL = TheICAPConfig.default_options_ttl;
+
     theTimestamp = httpHeaderGetTime(h, HDR_DATE);
 
     if (theTimestamp < 0)
index c5ea12afe4fef09fa4073b48da3d178456117c6b..666e8f253006bf467a94e0e400394cf68f7489dc 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.408 2005/12/01 23:23:59 wessels Exp $
+# $Id: cf.data.pre,v 1.409 2005/12/13 22:17:02 wessels Exp $
 #
 #
 # SQUID Web Proxy Cache                http://www.squid-cache.org/
@@ -4789,6 +4789,16 @@ DOC_START
         basis by OPTIONS requests.
 DOC_END
 
+NAME: icap_default_options_ttl
+TYPE: int
+IFDEF: ICAP_CLIENT
+LOC: TheICAPConfig.default_options_ttl
+DEFAULT: 60
+DOC_START
+        The default TTL value for ICAP OPTIONS responses that don't have
+       an Options-TTL header.
+DOC_END
+
 NAME: icap_persistent_connections
 TYPE: onoff
 IFDEF: ICAP_CLIENT