summaryrefslogtreecommitdiff
blob: c7ac8c5d3c4e1545e9ec926096c7ed53748c8fcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -Nru squid-3.0.STABLE18.orig/src/HttpHeaderTools.cc squid-3.0.STABLE18/src/HttpHeaderTools.cc
--- squid-3.0.STABLE18.orig/src/HttpHeaderTools.cc	2009-08-04 13:57:48.000000000 +0200
+++ squid-3.0.STABLE18/src/HttpHeaderTools.cc	2009-08-22 11:43:40.000000000 +0200
@@ -246,6 +246,10 @@
 strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos)
 {
     size_t len;
+    /* ',' is always enabled as field delimiter as this is required for
+     * processing merged header values properly, even if Cookie normally
+     * uses ';' as delimiter.
+    */
     static char delim[3][8] = {
 			"\"?,",
 			"\"\\",
@@ -273,19 +277,16 @@
     do {
         *pos += strcspn(*pos, delim[quoted]);
 
-        if (**pos == del)
-            break;
-
         if (**pos == '"') {
             quoted = !quoted;
             *pos += 1;
-        }
-
-        if (quoted && **pos == '\\') {
+        } else if (quoted && **pos == '\\') {
             *pos += 1;
 
             if (**pos)
                 *pos += 1;
+        } else {
+            break;		/* Delimiter found, marking the end of this value */
         }
     } while (**pos);