]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Support for Method header in ICAP OPTIONS respose.
authorwessels <>
Wed, 14 Dec 2005 00:32:34 +0000 (00:32 +0000)
committerwessels <>
Wed, 14 Dec 2005 00:32:34 +0000 (00:32 +0000)
Currently the 'icap_service' directive in squid.conf specifies both the
URI and method.  The ICAP server also returns the method in the OPTIONS
response.  This could create a conflict if the user specifies the wrong
method for a service.

For now we trust the squid.conf value and issue a warning if the OPTIONS
response reports a different method.

src/ICAP/ICAPServiceRep.cc

index 026e9a394e7b2fb1afac640a1f1aecac6c80fb78..dfda856ca0f4e6d6dd4dbbbca72649478607cf90 100644 (file)
@@ -278,6 +278,16 @@ void ICAPServiceRep::changeOptions(ICAPOptions *newOptions)
            newOptions);
     delete theOptions;
     theOptions = newOptions;
+
+    /*
+     * Maybe it would be better if squid.conf just listed the URI and
+     * then discovered the method via OPTIONS
+     */
+
+    if (theOptions->method != method)
+        debugs(93,1, "WARNING: Squid is configured to use ICAP method " << ICAP::methodStr(method) <<
+               "for service " << uri.buf() <<
+               "but OPTIONS response declares the method is " << ICAP::methodStr(theOptions->method));
 }
 
 static