From: robertc <> Date: Mon, 14 Jul 2003 20:15:53 +0000 (+0000) Subject: Summary: Merge of robertc@squid-cache.org--squid/squid--esi--3.0 X-Git-Tag: SQUID_3_0_PRE1~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=924f73bcfeb2e6e499f3836e2adf7414d0a5c114;p=thirdparty%2Fsquid.git Summary: Merge of robertc@squid-cache.org--squid/squid--esi--3.0 Keywords: Patches applied: * robertc@squid-cache.org--squid/squid--esi--3.0--patch-149 Fixup test-suite makefile pre-merge. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-148 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-262 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-147 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-261 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-146 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-260 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-145 More merge fixups. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-144 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-259 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-143 Adjust for recent merges. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-142 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-258 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-141 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-257 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-140 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-256 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-139 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-255 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-138 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-254 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-137 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-253 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-136 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-252 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-135 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-251 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-134 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-250 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-133 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-249 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-132 Merge of projects@swelltech.com--private/squid--mem-to-disk--3.0--patch-1 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-131 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-247 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-130 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-246 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-129 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-245 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-128 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-244 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-127 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-243 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-126 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-242 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-125 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-241 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-124 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-240 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-123 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-239 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-122 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-238 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-121 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-237 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-120 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-236 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-119 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-235 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-118 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-234 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-117 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-233 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-116 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-232 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-115 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-231 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-114 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-230 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-113 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-229 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-112 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-228 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-111 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-227 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-110 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-226 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-109 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-225 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-108 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-224 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-107 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-223 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-106 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-222 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-105 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-221 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-104 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-220 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-103 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-219 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-102 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-218 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-101 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-217 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-100 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-216 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-99 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-215 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-98 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-214 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-97 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-213 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-96 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-212 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-95 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-211 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-94 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-210 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-93 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-209 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-92 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-208 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-91 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-207 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-90 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-206 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-89 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-205 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-88 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-204 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-87 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-203 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-86 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-202 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-85 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-201 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-84 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-200 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-83 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-199 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-82 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-198 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-81 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-197 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-80 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-196 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-79 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-195 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-78 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-194 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-77 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-193 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-76 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-192 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-75 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-191 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-74 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-190 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-73 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-189 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-72 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-188 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-71 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-187 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-70 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-186 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-69 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-185 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-68 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-184 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-67 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-183 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-66 Towards esi Functions. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-65 Refactoring towards ESI Functions. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-64 Propogate message headers to ESI includes. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-63 Extract HttpHeader class to HttpHeader.h * robertc@squid-cache.org--squid/squid--esi--3.0--patch-62 Extract ESIInclude to separate files. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-61 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-182 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-60 Merge of robertc@squid-cache.org--squid/squid--HEAD--3.0--patch-181 * robertc@squid-cache.org--squid/squid--esi--3.0--patch-59 Merge from HEAD * robertc@squid-cache.org--squid/squid--esi--3.0--patch-58 Prevent a race condition in esi includes. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-57 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-56 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-55 BUGFIX: Memory leak in ESI requests. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-54 BUGFIX: libTrie was returning random values when adding a node. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-53 Give libTrie stricter g++ flags. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-52 Parse '' correctly in esi expressions. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-51 Fixup build. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-50 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-49 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-48 ESI logging tweaks. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-47 Bugfix: redirection of internal requests would segv. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-46 Merge from HEAD * robertc@squid-cache.org--squid/squid--esi--3.0--patch-45 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-44 Implement variable evaluation in esi:assign short form. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-43 Implement ESI long form variable assignment. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-42 Inital addition of ESIAssign. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-41 Finish inserting all variables for ESI into a trie. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-40 Variable logic extraction. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-39 Separate out various variable logic. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-38 Allow character transforms for tries. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-37 ESI Variable refactoring to ease support of dynamic variables. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-36 Allow low expiry dates on objects when using ESI. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-35 Bugfix TrieNode constructor. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-34 Eliminate esiVarState::esiVar_t. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-33 Introduce esiVarState::Variable class. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-32 Merge from HEAD. * robertc@squid-cache.org--squid/squid--esi--3.0--patch-31 Merge CVS changes to ESI. --- diff --git a/lib/libTrie/configure.in b/lib/libTrie/configure.in index 367923ccf1..80ce90bd25 100644 --- a/lib/libTrie/configure.in +++ b/lib/libTrie/configure.in @@ -4,48 +4,59 @@ AC_CONFIG_SRCDIR([src/Trie.cc]) AM_CONFIG_HEADER([config.h]) SquidInline="yes" -AC_ARG_ENABLE(inline, -[ --disable-inline Don't compile trivial methods as inline. Squid - is coded with much of the code able to be inlined.< Inlining is good for production builds, but not - good for development. During development, use - --disable-inline to reduce compilation times and - allow incremental builds to be quick. For - production builds, or load tests, use - --enable-inline to have squid make all trivial - methods inlinable by the compiler.], -[ if test "$enableval" = "no" ; then - SquidInline="no" - fi -]) - -if test "$SquidInline" = "yes" ; then - AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) - AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file]) -else - AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods]) -fi + AC_ARG_ENABLE(inline, + [ --disable-inline Don't compile trivial methods as inline. Squid + is coded with much of the code able to be inlined.< Inlining is good for production builds, but not + good for development. During development, use + --disable-inline to reduce compilation times and + allow incremental builds to be quick. For + production builds, or load tests, use + --enable-inline to have squid make all trivial + methods inlinable by the compiler.], + [ if test "$enableval" = "no" ; then + SquidInline="no" + fi + ]) + + if test "$SquidInline" = "yes" ; then + AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods]) + AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file]) + else + AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods]) + fi # Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_MAKE_SET + AC_PROG_CXX + AC_PROG_CC + AC_PROG_MAKE_SET # for old automakes - like squid-cache.orgs! -AM_INIT_AUTOMAKE(libTrie, 0.1) -AM_MAINTAINER_MODE -AC_PROG_RANLIB + AM_INIT_AUTOMAKE(libTrie, 0.1) + AM_MAINTAINER_MODE + AC_PROG_RANLIB + + dnl set useful flags + if test "$GCC" = "yes"; then + TRIE_CFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" + TRIE_CXXFLAGS="-Werror -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wcomments" + else + TRIE_CFLAGS= + TRIE_CXXFLAGS= + fi + AC_SUBST(TRIE_CFLAGS) + AC_SUBST(TRIE_CXXFLAGS) # Checks for libraries. # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T + AC_C_CONST + AC_TYPE_SIZE_T # Checks for library functions. -AC_CONFIG_FILES([Makefile - include/Makefile - src/Makefile - test/Makefile]) -AC_OUTPUT + AC_CONFIG_FILES([Makefile + include/Makefile + src/Makefile + test/Makefile]) + AC_OUTPUT diff --git a/lib/libTrie/include/Makefile.am b/lib/libTrie/include/Makefile.am index a52bae3667..395e2db3be 100644 --- a/lib/libTrie/include/Makefile.am +++ b/lib/libTrie/include/Makefile.am @@ -1 +1 @@ -noinst_HEADERS = Trie.h TrieNode.h +noinst_HEADERS = Trie.h TrieNode.h TrieCharTransform.h diff --git a/lib/libTrie/include/Trie.cci b/lib/libTrie/include/Trie.cci index fe3e461e1d..ae77d501b8 100644 --- a/lib/libTrie/include/Trie.cci +++ b/lib/libTrie/include/Trie.cci @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,8 @@ void * Trie::find (char const *aString, size_t theLength) { if (head) - return head->find (aString, theLength); + return head->find (aString, theLength, transform, false); + return NULL; } @@ -33,7 +34,9 @@ void * Trie::findPrefix (char const *aString, size_t theLength) { if (head) - return head->find (aString, theLength, true); + return head->find (aString, theLength, transform, true); + return NULL; } + #endif diff --git a/lib/libTrie/include/Trie.h b/lib/libTrie/include/Trie.h index 838bfb7b19..856595689c 100644 --- a/lib/libTrie/include/Trie.h +++ b/lib/libTrie/include/Trie.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ /* C bindings */ #ifndef __cplusplus +/* TODO: provide parameterisation for C bindings */ void *TrieCreate (); void TrieDestroy (void *); void *TrieFind (void *, char const *, size_t); @@ -44,6 +45,8 @@ int TrieAdd (void *, char const *, size_t, void *); /* C++ bindings */ #else +class TrieCharTransform; + class TrieNode; /* TODO: parameterize this to be more generic - @@ -54,7 +57,7 @@ class Trie { public: - Trie(); + Trie(TrieCharTransform *aTransform = 0); ~Trie(); Trie (Trie const &); Trie &operator= (Trie const &); @@ -79,6 +82,9 @@ public: private: TrieNode *head; + + /* transfor each 8 bits in the element */ + TrieCharTransform *transform; }; #endif /* __cplusplus */ diff --git a/lib/libTrie/include/TrieCharTransform.h b/lib/libTrie/include/TrieCharTransform.h new file mode 100644 index 0000000000..523a39245c --- /dev/null +++ b/lib/libTrie/include/TrieCharTransform.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2003 Robert Collins + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#ifndef LIBTRIE_TRIECHARTRANSFORM_H +#define LIBTRIE_TRIECHARTRANSFORM_H + +/* This is an internal header for libTrie. + * libTrie provides both limited C and full C++ + * bindings. + * libTrie itself is written in C++. + * For C bindings see Trie.h + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* C bindings */ +#ifndef __cplusplus + +/* C++ bindings */ +#else +#include +#include +#include + +/* TODO: parameterize this to be more generic - +* i.e. M-ary internal node sizes etc +*/ + +class TrieCharTransform +{ + +public: + virtual ~TrieCharTransform() {} + + virtual char const operator () (char const) = 0; +}; + +class TrieCaseless : public TrieCharTransform +{ + virtual char const operator () (char const aChar) {return tolower(aChar);} +}; + +#endif /* __cplusplus */ + +#endif /* LIBTRIE_TRIECHARTRANSFORM_H */ diff --git a/lib/libTrie/include/TrieNode.cci b/lib/libTrie/include/TrieNode.cci index b51b7790e0..3d33fe6252 100644 --- a/lib/libTrie/include/TrieNode.cci +++ b/lib/libTrie/include/TrieNode.cci @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ #ifdef __cplusplus #include "TrieNode.h" +#include "TrieCharTransform.h" #ifdef HAVE_UNISTD_H #include #endif @@ -26,26 +27,31 @@ /* recursive. TODO? make iterative */ void * -TrieNode::find (char const *aString, size_t theLength, bool prefix) const +TrieNode::find (char const *aString, size_t theLength, TrieCharTransform *transform, bool const prefix) const { if (theLength) { - int index = -1; - if (internal[*aString]) - index = *aString; - else if (internal[tolower(*aString)]) - index = tolower(*aString); - if (index > -1) { - void *result; - result = internal[index]->find(aString + 1, theLength - 1, prefix); - if (result) - return result; - } - if (prefix) - return _privateData; - return NULL; + int index = -1; + unsigned char pos = transform ? (*transform) (*aString) : *aString; + + if (internal[pos]) + index = pos; + + if (index > -1) { + void *result; + result = internal[index]->find(aString + 1, theLength - 1, transform, prefix); + + if (result) + return result; + } + + if (prefix) + return _privateData; + + return NULL; } else { - /* terminal node */ - return _privateData; + /* terminal node */ + return _privateData; } } + #endif diff --git a/lib/libTrie/include/TrieNode.h b/lib/libTrie/include/TrieNode.h index 950f8ce3f0..e9aaec8a3c 100644 --- a/lib/libTrie/include/TrieNode.h +++ b/lib/libTrie/include/TrieNode.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,6 +43,8 @@ * i.e. M-ary internal node sizes etc */ +class TrieCharTransform; + class TrieNode { @@ -56,7 +58,7 @@ public: * If found, return the private data. * If not found, return NULL. */ - _SQUID_INLINE_ void *find (char const *, size_t, bool prefix = false) const; + _SQUID_INLINE_ void *find (char const *, size_t, TrieCharTransform *, bool const prefix) const; /* Add a string. * returns false if the string is already @@ -64,7 +66,7 @@ public: */ bool add - (char const *, size_t, void *); + (char const *, size_t, void *, TrieCharTransform *); private: /* 256-way Trie */ diff --git a/lib/libTrie/src/Makefile.am b/lib/libTrie/src/Makefile.am index 95d3fa5455..0fed01f36f 100644 --- a/lib/libTrie/src/Makefile.am +++ b/lib/libTrie/src/Makefile.am @@ -1,6 +1,9 @@ INCLUDES = -I$(top_srcdir)/include +AM_CFLAGS = @TRIE_CFLAGS@ +AM_CXXFLAGS = @TRIE_CXXFLAGS@ + noinst_LIBRARIES = libTrie.a libTrie_a_SOURCES = Trie.cc \ diff --git a/lib/libTrie/src/Trie.cc b/lib/libTrie/src/Trie.cc index 3226e9be56..150fb1716e 100644 --- a/lib/libTrie/src/Trie.cc +++ b/lib/libTrie/src/Trie.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +22,9 @@ #include #endif #include "TrieNode.h" +#include "TrieCharTransform.h" -Trie::Trie () : head (0) +Trie::Trie (TrieCharTransform *aTransform) : head (0) , transform (aTransform) {} extern "C" void *TrieCreate () @@ -34,6 +35,7 @@ extern "C" void *TrieCreate () Trie::~Trie () { delete head; + delete transform; } extern "C" void TrieDestroy (void *aTrie) @@ -59,13 +61,13 @@ Trie::add return false; return head->add - (aString, theLength, privatedata); + (aString, theLength, privatedata, transform); } head = new TrieNode; return head->add - (aString, theLength, privatedata); + (aString, theLength, privatedata, transform); } extern "C" int TrieAdd (void *aTrie, char const *aString, size_t theLength, void *privatedata) diff --git a/lib/libTrie/src/TrieNode.cc b/lib/libTrie/src/TrieNode.cc index a7f4786428..b5ea508429 100644 --- a/lib/libTrie/src/TrieNode.cc +++ b/lib/libTrie/src/TrieNode.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,12 +18,12 @@ */ #include "TrieNode.h" +#include "TrieCharTransform.h" #ifdef HAVE_UNISTD_H #include #endif -#include -TrieNode::TrieNode () +TrieNode::TrieNode () : _privateData (NULL) { for (int i = 0; i < 256; ++i) internal[i] = NULL; @@ -39,24 +39,18 @@ TrieNode::~TrieNode () bool TrieNode::add - (char const *aString, size_t theLength, void *privatedata) + (char const *aString, size_t theLength, void *privatedata, TrieCharTransform *transform) { /* We trust that privatedata and existant keys have already been checked */ if (theLength) { - int index; + int index = transform ? (*transform) (*aString): *aString; - if (internal[*aString]) - index = *aString; - else if (internal[tolower(*aString)]) - index = tolower (*aString); - else { - index = *aString; + if (!internal[index]) internal[index] = new TrieNode; - } - internal[index]->add - (aString + 1, theLength - 1, privatedata); + return internal[index]->add + (aString + 1, theLength - 1, privatedata, transform); } else { /* terminal node */ @@ -72,4 +66,3 @@ TrieNode::add #ifndef _USE_INLINE_ #include "TrieNode.cci" #endif - diff --git a/lib/libTrie/test/Makefile.am b/lib/libTrie/test/Makefile.am index dabb1ab44f..abb8cad137 100644 --- a/lib/libTrie/test/Makefile.am +++ b/lib/libTrie/test/Makefile.am @@ -1,5 +1,8 @@ INCLUDES = -I$(top_srcdir)/include +AM_CFLAGS = @TRIE_CFLAGS@ +AM_CXXFLAGS = @TRIE_CXXFLAGS@ + TESTS = trie trie-c check_PROGRAMS = trie trie-c @@ -9,4 +12,3 @@ trie_LDADD = $(top_builddir)/src/libTrie.a trie_c_SOURCES = trie-c.c trie_c_LDADD = $(top_builddir)/src/libTrie.a -lstdc++ - diff --git a/lib/libTrie/test/trie.cc b/lib/libTrie/test/trie.cc index b05d3c695c..d3ace8871b 100644 --- a/lib/libTrie/test/trie.cc +++ b/lib/libTrie/test/trie.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Robert Collins + * Copyright (c) 2002,2003 Robert Collins * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,9 +18,11 @@ */ #include "Trie.h" +#include "TrieCharTransform.h" #include -int main (int argc, char **argv) +bool +CaseSensitiveCheck() { Trie aTrie; @@ -39,10 +41,93 @@ int main (int argc, char **argv) return 1; } + if (!aTrie.add ("Uprefix", 8, (void *)3)) { + std::cerr << "Could not add Uprefix" << std::endl; + return 1; + } + + if (aTrie.find ("User-Agent", 10) != (void *)1) { + std::cerr << "Could not find User-Agent" << std::endl; + return 1; + } + + if (aTrie.find ("user-agent", 10) == (void *)1) { + std::cerr << "found user-agent" << std::endl; + return 1; + } + + if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) { + std::cerr << "Could not find User prefix" << std::endl; + return 1; + } + + if (aTrie.findPrefix("user-agentFoo" , 13) == (void *)1) { + std::cerr << "found user prefix" << std::endl; + return 1; + } + + return 0; +} + +bool +CaseInsensitiveCheck() +{ + Trie aTrie(new TrieCaseless); + + if (!aTrie.add ("User-Agent", 10, (void *)1)) { + std::cerr << "Could not add User-Agent" << std::endl; + return 1; + } + + if (aTrie.add ("user-agent", 10, (void *)2)) { + std::cerr << "Could add duplicate User-Agent" << std::endl; + return 1; + } + + if (!aTrie.add ("Alphabet", 8, (void *)3)) { + std::cerr << "Could not add Alphabet" << std::endl; + return 1; + } + + if (!aTrie.add ("uprefix", 8, (void *)3)) { + std::cerr << "Could not add uprefix" << std::endl; + return 1; + } + if (aTrie.find ("User-Agent", 10) != (void *)1) { std::cerr << "Could not find User-Agent" << std::endl; return 1; } + if (aTrie.find ("user-agent", 10) != (void *)1) { + std::cerr << "Could not find user-agent" << std::endl; + return 1; + } + + if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) { + std::cerr << "Could not find User prefix" << std::endl; + return 1; + } + + if (aTrie.findPrefix("user-agentFoo" , 13) != (void *)1) { + std::cerr << "Could not find user prefix" << std::endl; + return 1; + } + + return 0; +} + +int main (int argc, char **argv) +{ + if (CaseSensitiveCheck()) { + std::cerr << "Case sensitive check failure." << std::endl; + return 1; + } + + if (CaseInsensitiveCheck()) { + std::cerr << "Case in-sensitive check failure." << std::endl; + return 1; + } + return 0; } diff --git a/src/ACLChecklist.h b/src/ACLChecklist.h index 3aa9862561..a3edcaba9c 100644 --- a/src/ACLChecklist.h +++ b/src/ACLChecklist.h @@ -1,6 +1,6 @@ /* - * $Id: ACLChecklist.h,v 1.13 2003/07/11 01:40:34 robertc Exp $ + * $Id: ACLChecklist.h,v 1.14 2003/07/14 14:15:55 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -39,6 +39,8 @@ class ExternalACLEntry; +class ConnStateData; + class ACLChecklist { diff --git a/src/ACLReplyMIMEType.h b/src/ACLReplyMIMEType.h index f328689518..0e03f41d3c 100644 --- a/src/ACLReplyMIMEType.h +++ b/src/ACLReplyMIMEType.h @@ -1,6 +1,6 @@ /* - * $Id: ACLReplyMIMEType.h,v 1.2 2003/07/11 01:40:34 robertc Exp $ + * $Id: ACLReplyMIMEType.h,v 1.3 2003/07/14 14:15:55 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -40,6 +40,7 @@ #include "ACLReplyHeaderStrategy.h" #include "ACLStrategised.h" #include "ACLChecklist.h" +/* FIXME: TODO: this is broken - should be HttpReply checks!! */ #include "HttpRequest.h" class ACLReplyMIMEType diff --git a/src/ESI.cc b/src/ESI.cc index d02a28aed9..8a6006c4c0 100644 --- a/src/ESI.cc +++ b/src/ESI.cc @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.3 2003/03/15 04:17:38 robertc Exp $ + * $Id: ESI.cc,v 1.4 2003/07/14 14:15:55 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -45,6 +45,10 @@ #include "ESIAttempt.h" #include "ESIExcept.h" #include "client_side.h" +#include "ESIVarState.h" +#include "ESIAssign.h" +#include "ESIExpression.h" +#include "HttpRequest.h" /* quick reference on behaviour here. * The ESI specification 1.0 requires the ESI processor to be able to @@ -57,8 +61,6 @@ class ESIStreamContext; -typedef class ESIStreamContext esiStreamContext; - /* TODO: split this out into separate files ? */ /* Parsing: quick and dirty. ESI files are not valid XML, so a generic * XML parser is not much use. Also we need a push parser not a pull @@ -86,107 +88,6 @@ bool operator == (ESIElement const *lhs, ESIElement::Pointer const &rhs) return lhs == rhs.getRaw(); } - -/* esi variable replacement logic */ - -typedef enum { - ESI_BROWSER_MSIE, - ESI_BROWSER_MOZILLA, - ESI_BROWSER_OTHER -} esiBrowser_t; - -static char const * esiBrowsers[]= - {"MSIE", - "MOZILLA", - "OTHER" - }; - -/* Recursive uses are not supported by design */ - -struct _query_elem{char *var, *val;}; - -struct esiVarState -{ - ESISegment::Pointer extractList(); - char *extractChar(); - void feedData (const char *buf, size_t len); - void buildVary (HttpReply *rep); - - void *operator new (size_t byteCount); - void operator delete (void *address); - void deleteSelf() const; - void freeResources(); - esiVarState (HttpHeader const *hdr, char const *uri); - -private: - char *getProductVersion (char const *s); - ESISegment::Pointer input; - ESISegment::Pointer output; - HttpHeader hdr; - - struct _query_elem *query; - size_t query_sz; - size_t query_elements; - char *query_string; - - struct - { - -int language: - 1; - -int cookie: - 1; - -int host: - 1; - -int referer: - 1; - -int useragent: - 1; - } - - flags; - esiBrowser_t browser; - char *browserversion; - enum esiVar_t { - ESI_VAR_LANGUAGE, - ESI_VAR_COOKIE, - ESI_VAR_HOST, - ESI_VAR_REFERER, - ESI_VAR_USERAGENT, - ESI_QUERY_STRING, - ESI_VAR_OTHER - }; - void doIt (); - void eval (esiVar_t type, char const *, char const *); - enum esiUserOs_t{ - ESI_OS_WIN, - ESI_OS_MAC, - ESI_OS_UNIX, - ESI_OS_OTHER - } UserOs; - static char const * esiUserOs[]; - static esiVar_t GetVar(char *s, int len); - bool validChar (char c); -}; - -CBDATA_TYPE (esiVarState); -FREE esiVarStateFree; - -char const *esiVarState::esiUserOs[]= - { - "WIN", - "MAC", - "UNIX", - "OTHER" - }; - - -extern int esiExpressionEval (char const *); - typedef ESIContext::esiKick_t esiKick_t; @@ -202,7 +103,7 @@ struct esiComment : public ESIElement ~esiComment(); esiComment(); Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; + Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; void render(ESISegment::Pointer); void finish(); @@ -213,89 +114,13 @@ private: MemPool * esiComment::pool = NULL; -class esiInclude; -typedef RefCount esiIncludePtr; - -class ESIStreamContext : public RefCountable -{ - -public: - typedef RefCount Pointer; - void *operator new(size_t); - void operator delete(void *); - void deleteSelf() const; - ESIStreamContext(); - ~ESIStreamContext(); - void freeResources(); - int finished; - esiIncludePtr include; - ESISegment::Pointer localbuffer; - ESISegment::Pointer buffer; - -private: - CBDATA_CLASS(ESIStreamContext); -}; - -CBDATA_CLASS_INIT (ESIStreamContext); #include "ESILiteral.h" MemPool *esiLiteral::pool = NULL; #include "ESISequence.h" -/* esiInclude */ - -class esiInclude : public ESIElement -{ - -public: - void *operator new (size_t byteCount); - void operator delete (void *address); - void deleteSelf() const; - - esiInclude(esiTreeParentPtr, int attributes, const char **attr, ESIContext *); - ~esiInclude(); - void render(ESISegment::Pointer); - esiProcessResult_t process (int dovars); - Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; - void subRequestDone (ESIStreamContext::Pointer, bool); - - struct - { - -int onerrorcontinue: - 1; /* on error return zero data */ - -int failed: - 1; /* Failed to process completely */ - -int finished: - 1; /* Finished getting subrequest data */ - } - - flags; - ESIStreamContext::Pointer src; - ESIStreamContext::Pointer alt; - ESISegment::Pointer srccontent; - ESISegment::Pointer altcontent; - esiVarState *varState; - char *srcurl, *alturl; - void fail(ESIStreamContext::Pointer); - void finish(); - -private: - static MemPool *Pool; - static void Start (ESIStreamContext::Pointer, char const *, esiVarState *); - esiTreeParentPtr parent; - void start(); - bool started; - bool sent; - esiInclude(esiInclude const &); - bool dataNeeded() const; -}; - -MemPool *esiInclude::Pool = NULL; +#include "ESIInclude.h" /* esiRemove */ @@ -311,7 +136,7 @@ public: void render(ESISegment::Pointer); bool addElement (ESIElement::Pointer); Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; + Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; void finish(); }; @@ -333,11 +158,11 @@ struct esiTry : public ESIElement void render(ESISegment::Pointer); bool addElement (ESIElement::Pointer); - void fail(ESIElement *); + void fail(ESIElement *, char const * = NULL); esiProcessResult_t process (int dovars); void provideData (ESISegment::Pointer data, ESIElement * source); Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; + Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; ESIElement::Pointer attempt; ESIElement::Pointer except; @@ -372,18 +197,7 @@ private: MemPool *esiTry::Pool = NULL; -/* esiVar */ - -struct esiVar:public esiSequence -{ - // void *operator new (size_t byteCount); - // void operator delete (void *address); - void deleteSelf() const; - esiVar(esiTreeParentPtr aParent) : esiSequence (aParent) - { - flags.dovars = 1; - } -}; +#include "ESIVar.h" /* esiChoose */ @@ -398,14 +212,14 @@ struct esiChoose : public ESIElement void render(ESISegment::Pointer); bool addElement (ESIElement::Pointer); - void fail(ESIElement *); + void fail(ESIElement *, char const * = NULL); esiProcessResult_t process (int dovars); void provideData (ESISegment::Pointer data, ESIElement *source); void makeCachableElements(esiChoose const &old); - void makeUsableElements(esiChoose const &old, esiVarState &); + void makeUsableElements(esiChoose const &old, ESIVarState &); Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; + Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; void NULLUnChosen(); ElementList elements; @@ -430,10 +244,10 @@ struct esiWhen : public esiSequence void *operator new (size_t byteCount); void operator delete (void *address); void deleteSelf() const; - esiWhen(esiTreeParentPtr aParent, int attributes, const char **attr, esiVarState *); + esiWhen(esiTreeParentPtr aParent, int attributes, const char **attr, ESIVarState *); ~esiWhen(); Pointer makeCacheable() const; - Pointer makeUsable(esiTreeParentPtr, esiVarState &) const; + Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const; bool testsTrue() const { return testValue;} @@ -444,7 +258,7 @@ private: esiWhen (esiWhen const &); bool testValue; char const *unevaluatedExpression; - esiVarState *varState; + ESIVarState *varState; void evaluate(); }; @@ -487,16 +301,7 @@ ESIStreamContext::ESIStreamContext() : finished(false), include (NULL), localbuf /* Local functions */ /* ESIContext */ static ESIContext *ESIContextNew(HttpReply *, clientStreamNode *, clientHttpRequest *); -/* esiStreamContext */ -static esiStreamContext *esiStreamContextNew (esiIncludePtr); - -/* other */ -static CSCB esiBufferRecipient; -static CSD esiBufferDetach; -/* ESI TO CONSIDER: - * 1. retry failed upstream requests - */ void * ESIContext::operator new(size_t byteCount) @@ -564,9 +369,10 @@ ESIContext::provideData (ESISegment::Pointer theData, ESIElement * source) } void -ESIContext::fail (ESIElement * source) +ESIContext::fail (ESIElement * source, char const *anError) { setError(); + setErrorMessage (anError); fail (); send (); } @@ -613,7 +419,7 @@ ESIContext::kick () break; case ESI_PROCESS_FAILED: - debug (86,0)("esiKick: esiProcess %p FAILED\n", this); + debug (86,2)("esiKick: esiProcess %p FAILED\n", this); /* this can not happen - processing can't fail until we have data, * and when we come here we have sent data to the client */ @@ -1128,7 +934,7 @@ ESIContextNew (HttpReply *rep, clientStreamNode *thisNode, clientHttpRequest *ht rv->thisNode = thisNode; rv->http = http; rv->flags.clientwantsdata = 1; - rv->varState = new esiVarState (&http->request->header, http->uri); + rv->varState = new ESIVarState (&http->request->header, http->uri); debug (86,5)("ESIContextNew: Client wants data (always created during reply cycle\n"); } @@ -1164,6 +970,9 @@ ESIElement::IdentifyElement (const char *el) if (!strncmp (el + offset, "attempt", 7)) return ESI_ELEMENT_ATTEMPT; + if (!strncmp (el + offset, "assign", 6)) + return ESI_ELEMENT_ASSIGN; + if (!strncmp (el + offset, "remove", 6)) return ESI_ELEMENT_REMOVE; @@ -1270,7 +1079,7 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount) case ESIElement::ESI_ELEMENT_INCLUDE: /* Put on the stack to allow skipping of 'invalid' markup */ - element = new esiInclude (parserState.top().getRaw(), specifiedattcount, attr, this); + element = new ESIInclude (parserState.top().getRaw(), specifiedattcount, attr, this); break; case ESIElement::ESI_ELEMENT_REMOVE: @@ -1295,7 +1104,7 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount) case ESIElement::ESI_ELEMENT_VARS: /* Put on the stack to allow skipping of 'invalid' markup */ - element = new esiVar (parserState.top().getRaw()); + element = new ESIVar (parserState.top().getRaw()); break; case ESIElement::ESI_ELEMENT_CHOOSE: @@ -1312,6 +1121,11 @@ ESIContext::start(const char *el, const char **attr, size_t attrCount) /* Put on the stack to allow skipping of 'invalid' markup */ element = new esiOtherwise (parserState.top().getRaw()); break; + + case ESIElement::ESI_ELEMENT_ASSIGN: + /* Put on the stack to allow skipping of 'invalid' markup */ + element = new ESIAssign (parserState.top().getRaw(), specifiedattcount, attr, this); + break; } addStackElement(element); @@ -1364,6 +1178,8 @@ ESIContext::end(const char *el) case ESIElement::ESI_ELEMENT_WHEN: case ESIElement::ESI_ELEMENT_OTHERWISE: + + case ESIElement::ESI_ELEMENT_ASSIGN: /* pop of the stack */ parserState.stack[--parserState.stackdepth] = NULL; break; @@ -1403,8 +1219,7 @@ ESIContext::parserComment (const char *s) tempParser->errorString()); debug (86,0)("%s",tempstr); - if (!errormessage) - errormessage = xstrdup (tempstr); + setErrorMessage(tempstr); } debug (86,5)("ESIContext::parserComment: ESI