--------------------- PatchSet 2107 Date: 2005/11/04 00:21:34 Author: dwsquid Branch: squid3-icap Tag: (none) Log: Move methodStr() and vectPointStr() to ICAPElements so we can use them outside of ICAPServiceRep class. Members: src/ICAPElements.cc:1.1.2.1->1.1.2.2 src/ICAPElements.h:1.1.2.1->1.1.2.2 src/ICAPServiceRep.cc:1.1.2.8->1.1.2.9 Index: squid3/src/ICAPElements.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPElements.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid3/src/ICAPElements.cc 17 Oct 2005 22:34:13 -0000 1.1.2.1 +++ squid3/src/ICAPElements.cc 4 Nov 2005 00:21:34 -0000 1.1.2.2 @@ -2,3 +2,51 @@ #include "ICAPElements.h" const char *ICAP::crlf = "\r\n"; + + +const char * +ICAP::methodStr(ICAP::Method method) +{ + switch(method) { + + case ICAP::methodReqmod: + return "REQMOD"; + break; + + case ICAP::methodRespmod: + return "RESPMOD"; + break; + + case ICAP::methodOptions: + return "OPTIONS"; + break; + + default: + break; + } + + return "NONE"; +} + + +const char * +ICAP::vectPointStr(ICAP::VectPoint point) +{ + switch(point) { + + case ICAP::pointPreCache: + return "PRECACHE"; + break; + + case ICAP::pointPostCache: + return "POSTCACHE"; + break; + + default: + break; + } + + return "NONE"; +} + + Index: squid3/src/ICAPElements.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPElements.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid3/src/ICAPElements.h 17 Oct 2005 22:34:13 -0000 1.1.2.1 +++ squid3/src/ICAPElements.h 4 Nov 2005 00:21:34 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* - * $Id: ICAPElements.h,v 1.1.2.1 2005/10/17 22:34:13 rousskov Exp $ + * $Id: ICAPElements.h,v 1.1.2.2 2005/11/04 00:21:34 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -48,6 +48,8 @@ enum { MsgPipeBufSizeMin = (4*1024), MsgPipeBufSizeMax = SQUID_TCP_SO_RCVBUF }; static const char *crlf; + static const char *methodStr(ICAP::Method); + static const char *vectPointStr(ICAP::VectPoint); }; #endif /* SQUID_ICAPCLIENT_H */ Index: squid3/src/ICAPServiceRep.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPServiceRep.cc,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- squid3/src/ICAPServiceRep.cc 17 Oct 2005 23:30:37 -0000 1.1.2.8 +++ squid3/src/ICAPServiceRep.cc 4 Nov 2005 00:21:34 -0000 1.1.2.9 @@ -29,25 +29,7 @@ const char * ICAPServiceRep::methodStr() const { - switch(method) { - - case ICAP::methodReqmod: - return "REQMOD"; - break; - - case ICAP::methodRespmod: - return "RESPMOD"; - break; - - case ICAP::methodOptions: - return "OPTIONS"; - break; - - default: - break; - } - - return "NONE"; + return ICAP::methodStr(method); } ICAP::Method @@ -66,21 +48,7 @@ const char * ICAPServiceRep::vectPointStr() const { - switch(point) { - - case ICAP::pointPreCache: - return "PRECACHE"; - break; - - case ICAP::pointPostCache: - return "POSTCACHE"; - break; - - default: - break; - } - - return "NONE"; + return ICAP::vectPointStr(point); } ICAP::VectPoint