--------------------- PatchSet 1936 Date: 2005/10/05 22:24:28 Author: rousskov Branch: squid3-icap Tag: (none) Log: - Added wantsPreview() method to report whether the service supports Preview and what Preview size it prefers. - Added allows204() method that always returns true; we may want to add some ACLs to disable 204s with ICAP servers that generate buggy 204 responses outside of Preview Members: src/ICAPServiceRep.cc:1.1.2.5->1.1.2.6 src/ICAPServiceRep.h:1.1.2.5->1.1.2.6 Index: squid3/src/ICAPServiceRep.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPServiceRep.cc,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid3/src/ICAPServiceRep.cc 29 Sep 2005 18:00:44 -0000 1.1.2.5 +++ squid3/src/ICAPServiceRep.cc 5 Oct 2005 22:24:28 -0000 1.1.2.6 @@ -176,3 +176,19 @@ }; +bool ICAPServiceRep::wantsPreview(size_t &wantedSize) const +{ + const int size = opts->headers->preview; + + if (size < 0) + return false; + + wantedSize = size; + + return true; +} + +bool ICAPServiceRep::allows204() const +{ + return true; // in the future, we may have ACLs to prevent 204s +} Index: squid3/src/ICAPServiceRep.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPServiceRep.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid3/src/ICAPServiceRep.h 29 Sep 2005 18:00:44 -0000 1.1.2.5 +++ squid3/src/ICAPServiceRep.h 5 Oct 2005 22:24:28 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: ICAPServiceRep.h,v 1.1.2.5 2005/09/29 18:00:44 dwsquid Exp $ + * $Id: ICAPServiceRep.h,v 1.1.2.6 2005/10/05 22:24:28 rousskov Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -55,6 +55,9 @@ const char *methodStr(); const char *vectPointStr(); + bool wantsPreview(size_t &wantedSize) const; + bool allows204() const; + typedef enum { no_icap_method, reqmod, respmod, options } IcapMethod; typedef enum { no_vect_point, precache, postcache } IcapVectPoint;