--------------------- PatchSet 4937 Date: 2002/09/09 13:07:56 Author: rbcollins Branch: esi Tag: (none) Log: Preliminary Namespace support Members: src/ESI.c:1.1.2.34->1.1.2.35 Index: squid/src/ESI.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/ESI.c,v retrieving revision 1.1.2.34 retrieving revision 1.1.2.35 diff -u -r1.1.2.34 -r1.1.2.35 --- squid/src/ESI.c 5 Sep 2002 07:38:04 -0000 1.1.2.34 +++ squid/src/ESI.c 9 Sep 2002 13:07:56 -0000 1.1.2.35 @@ -1,6 +1,6 @@ /* - * $Id: ESI.c,v 1.1.2.34 2002/09/05 07:38:04 rbcollins Exp $ + * $Id: ESI.c,v 1.1.2.35 2002/09/09 13:07:56 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -899,28 +899,35 @@ esiElementType_t esiIdentifyElement (const XML_Char *el) { + int offset = 0; assert (el); - if (strlen (el) < 5 || strncmp (el, "esi:", 4)) + if (strlen (el) < 5) return ESI_ELEMENT_NONE; - if (!strncmp (el + 4, "otherwise", 9)) + if (!strncmp (el, "esi:", 4)) + offset = 4; + else if (!strncmp (el, "http://www.edge-delivery.org/esi/1.0|", 37)) + offset = 37; + else + return ESI_ELEMENT_NONE; + if (!strncmp (el + offset, "otherwise", 9)) return ESI_ELEMENT_OTHERWISE; - if (!strncmp (el + 4, "comment", 7)) + if (!strncmp (el + offset, "comment", 7)) return ESI_ELEMENT_COMMENT; - if (!strncmp (el + 4, "include", 7)) + if (!strncmp (el + offset, "include", 7)) return ESI_ELEMENT_INCLUDE; - if (!strncmp (el + 4, "attempt", 7)) + if (!strncmp (el + offset, "attempt", 7)) return ESI_ELEMENT_ATTEMPT; - if (!strncmp (el + 4, "remove", 6)) + if (!strncmp (el + offset, "remove", 6)) return ESI_ELEMENT_REMOVE; - if (!strncmp (el + 4, "except", 6)) + if (!strncmp (el + offset, "except", 6)) return ESI_ELEMENT_EXCEPT; - if (!strncmp (el + 4, "choose", 6)) + if (!strncmp (el + offset, "choose", 6)) return ESI_ELEMENT_CHOOSE; - if (!strncmp (el + 4, "vars", 4)) + if (!strncmp (el + offset, "vars", 4)) return ESI_ELEMENT_VARS; - if (!strncmp (el + 4, "when", 4)) + if (!strncmp (el + offset, "when", 4)) return ESI_ELEMENT_WHEN; - if (!strncmp (el + 4, "try", 3)) + if (!strncmp (el + offset, "try", 3)) return ESI_ELEMENT_TRY; return ESI_ELEMENT_NONE; @@ -1101,7 +1108,7 @@ if (!strncmp(s, "esi",3)) { XML_Parser p; debug (86,5)("esiExpatComment: ESI