From 78e8cfc4936f16e4a35938dd7838fea4a69237b8 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 14 Dec 2005 05:17:02 +0000 Subject: [PATCH] Added a default ICAP Options-TTL setting. --- src/ICAP/ICAPConfig.h | 3 ++- src/ICAP/ICAPOptions.cc | 6 ++++++ src/cf.data.pre | 12 +++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/ICAP/ICAPConfig.h b/src/ICAP/ICAPConfig.h index 0b95ee8742..affa991060 100644 --- a/src/ICAP/ICAPConfig.h +++ b/src/ICAP/ICAPConfig.h @@ -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; diff --git a/src/ICAP/ICAPOptions.cc b/src/ICAP/ICAPOptions.cc index 9b96d33d72..a779114c63 100644 --- a/src/ICAP/ICAPOptions.cc +++ b/src/ICAP/ICAPOptions.cc @@ -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) diff --git a/src/cf.data.pre b/src/cf.data.pre index c5ea12afe4..666e8f2530 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 -- 2.39.5