--------------------- PatchSet 10241 Date: 2007/12/14 06:46:33 Author: adri Branch: s27_adri Tag: (none) Log: Add strCStr(const char *, String) to do strstr-type things. Members: libbuf/String.h:1.1.2.13->1.1.2.14 src/http.c:1.63.2.3.4.6->1.63.2.3.4.7 Index: squid/libbuf/String.h =================================================================== RCS file: /cvsroot/squid-sf//squid/libbuf/Attic/String.h,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -r1.1.2.13 -r1.1.2.14 --- squid/libbuf/String.h 14 Dec 2007 06:11:26 -0000 1.1.2.13 +++ squid/libbuf/String.h 14 Dec 2007 06:46:33 -0000 1.1.2.14 @@ -44,6 +44,7 @@ /* XXX None of these functions are non-NUL safe and they need to be later replaced */ #define strStr(s,str) ((const char*)strstr(strBuf(s), (str))) +#define strCStr(str, s) ((const char *) strstr(str, strBuf(s))) #define strCmp(s,str) strcmp(strBuf(s), (str)) #define strNCmp(s,str,n) strncmp(strBuf(s), (str), (n)) #define strCaseCmp(s,str) strcasecmp(strBuf(s), (str)) Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.63.2.3.4.6 retrieving revision 1.63.2.3.4.7 diff -u -r1.63.2.3.4.6 -r1.63.2.3.4.7 --- squid/src/http.c 14 Dec 2007 06:11:28 -0000 1.63.2.3.4.6 +++ squid/src/http.c 14 Dec 2007 06:46:33 -0000 1.63.2.3.4.7 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.63.2.3.4.6 2007/12/14 06:11:28 adri Exp $ + * $Id: http.c,v 1.63.2.3.4.7 2007/12/14 06:46:33 adri Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -1329,7 +1329,7 @@ const char *url = entry ? storeUrl(entry) : urlCanonical(orig_request); httpHdrCcSetMaxAge(cc, getMaxAge(url)); if (strIsNotNull(request->urlpath) && strLen2(request->urlpath) > 0) - assert(strstr(url, strBuf(request->urlpath))); + assert(strCStr(url, request->urlpath)); } /* Set no-cache if determined needed but not found */ if (orig_request->flags.nocache && !httpHeaderHas(hdr_in, HDR_PRAGMA))