]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added eCAP-specific squid.conf options: ecap_enable and ecap_service.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 8 May 2008 20:19:48 +0000 (14:19 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 8 May 2008 20:19:48 +0000 (14:19 -0600)
It is not clear whether we should have ecap_service and icap_service or
merge the two as adaptation_service and just look at the protocol field
of the service URI. One reason to keep the options separate is that some
ICAP services might use http schemes in their URIs, but I do not know how
common that is. Another reason is it makes it easier to add protocol-specific
options.

TODO: Discuss whether similar eCAP and ICAP options should be documented
separately. The alternative is to document one of them and point to that
documentation from the other.

Removed ICAPConfig from deprecated icap_ options that do not use it anymore.

src/cache_cf.cc
src/cf.data.depend
src/cf.data.pre

index b6e9c53092d0bd0fc6a7db95d37f22dbae4c4656..c6b82144da9286693360df5e88e1ce2124fe337b 100644 (file)
 #include "adaptation/Config.h"
 
 static void parse_adaptation_service_set_type();
-
 static void parse_adaptation_access_type();
-static void dump_adaptation_access_type(StoreEntry *, const char *);
-static void free_adaptation_access_type();
 
 #endif
 
 #if ICAP_CLIENT
 #include "ICAP/ICAPConfig.h"
 
+static void free_adaptation_access_type(const char *);
+
 static void parse_icap_service_type(ICAPConfig *);
 static void dump_icap_service_type(StoreEntry *, const char *, const ICAPConfig &);
 static void free_icap_service_type(ICAPConfig *);
@@ -86,6 +85,13 @@ static void free_icap_access_type(ICAPConfig *);
 
 #endif
 
+#if USE_ECAP
+#include "eCAP/Config.h"
+static void parse_ecap_service_type(Ecap::Config *);
+static void dump_ecap_service_type(StoreEntry *, const char *, const Ecap::Config &);
+static void free_ecap_service_type(Ecap::Config *);
+#endif
+
 CBDATA_TYPE(peer);
 
 static const char *const T_SECOND_STR = "second";
@@ -3446,18 +3452,6 @@ parse_adaptation_access_type()
     Adaptation::Config::ParseAccess(LegacyParser);
 }
 
-static void
-free_adaptation_access_type()
-{
-    Adaptation::Config::FreeAccess();
-}
-
-static void
-dump_adaptation_access_type(StoreEntry * entry, const char *name)
-{
-    Adaptation::Config::DumpAccess(entry, name);
-}
-
 #endif /* USE_ADAPTATION */
 
 
@@ -3506,19 +3500,43 @@ parse_icap_access_type(ICAPConfig *)
 {
     debugs(93, 0, "WARNING: 'icap_access' is depricated. " <<
         "Use 'adaptation_access' instead");
-    parse_adaptation_access_type();
+    Adaptation::Config::ParseAccess(LegacyParser);
 }
 
+
 static void
 free_icap_access_type(ICAPConfig *)
 {
-    free_adaptation_access_type();
+    Adaptation::Config::FreeAccess();
 }
 
 static void
 dump_icap_access_type(StoreEntry * entry, const char *name, const ICAPConfig &)
 {
-    dump_adaptation_access_type(entry, name);
+    Adaptation::Config::DumpAccess(entry, name);
 }
 
 #endif
+
+
+#if USE_ECAP
+
+static void
+parse_ecap_service_type(Ecap::Config * cfg)
+{
+    cfg->parseService();
+}
+
+static void
+free_ecap_service_type(Ecap::Config * cfg)
+{
+    cfg->freeService();
+}
+
+static void
+dump_ecap_service_type(StoreEntry * entry, const char *name, const Ecap::Config &cfg)
+{
+    cfg.dumpService(entry, name);
+}
+
+#endif /* USE_ECAP */
index 5c48bc19dc43b8fe8b7dfd11bf2be65b4f0cb5e7..c259e612b1a3387f87758788e7830056536f2418 100644 (file)
@@ -30,6 +30,7 @@ adaptation_service_set_type   icap_service
 icap_access_type       icap_class acl
 icap_class_type                icap_service
 icap_service_type
+ecap_service_type
 int
 kb_int64_t
 kb_size_t
index 09621c3c10ee9d475df4c9dd0ba260d132631029..bf80ad2efb1782cba6ffe39e760d5b0c123872c4 100644 (file)
@@ -5004,7 +5004,7 @@ DOC_END
 NAME: icap_class
 TYPE: icap_class_type
 IFDEF: ICAP_CLIENT
-LOC: TheICAPConfig
+LOC: none
 DEFAULT: none
 DOC_START
        This depricated option was documented to define an ICAP service
@@ -5021,7 +5021,7 @@ DOC_END
 NAME: icap_access
 TYPE: icap_access_type
 IFDEF: ICAP_CLIENT
-LOC: TheICAPConfig
+LOC: none
 DEFAULT: none
 DOC_START
         This option is depricated. Please use adaptation_access, which
@@ -5034,6 +5034,45 @@ COMMENT_START
  -----------------------------------------------------------------------------
 COMMENT_END
 
+NAME: ecap_enable
+TYPE: onoff
+IFDEF: USE_ECAP
+COMMENT: on|off
+LOC: Ecap::TheConfig.onoff
+DEFAULT: off
+DOC_START
+       Controls whether eCAP support is enabled.
+DOC_END
+
+NAME: ecap_service
+TYPE: ecap_service_type
+IFDEF: USE_ECAP
+LOC: Ecap::TheConfig
+DEFAULT: none
+DOC_START
+       Defines a single eCAP service
+
+       ecap_service servicename vectoring_point bypass service_url
+
+       vectoring_point = reqmod_precache|reqmod_postcache|respmod_precache|respmod_postcache
+               This specifies at which point of transaction processing the
+               eCAP service should be activated. *_postcache vectoring points
+               are not yet supported.
+       bypass = 1|0
+               If set to 1, the eCAP service is treated as optional. If the
+               service cannot be reached or malfunctions, Squid will try to
+               ignore any errors and process the message as if the service
+               was not enabled. No all eCAP errors can be bypassed.
+               If set to 0, the eCAP service is treated as essential and all
+               eCAP errors will result in an error page returned to the
+               HTTP client.
+       service_url = ecap://vendor/service_name?custom&cgi=style&parameters=optional
+
+Example:
+ecap_service service_1 reqmod_precache 0 ecap://filters-R-us/leakDetector?on_error=block
+ecap_service service_2 respmod_precache 1 icap://filters-R-us/virusFilter?config=/etc/vf.cfg
+DOC_END
+
 NAME: loadable_modules
 TYPE: wordlist
 IFDEF: USE_LOADABLE_MODULES