--------------------- PatchSet 4872 Date: 2002/09/05 07:38:04 Author: rbcollins Branch: esi Tag: (none) Log: * honour hostnames in includes. Ramifications: includes are no longer redirected as accelerated requests. i.e. will not work, should be used instead. * Detect the last language in the browser presented list. Ramifications: None. * Correctly process multi-value query strings. Ramifications: None. Members: src/ESI.c:1.1.2.33->1.1.2.34 src/client_side_request.c:1.1.2.13->1.1.2.14 src/forward.c:1.16->1.16.2.1 src/structs.h:1.61.2.11->1.61.2.12 Index: squid/src/ESI.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/ESI.c,v retrieving revision 1.1.2.33 retrieving revision 1.1.2.34 diff -u -r1.1.2.33 -r1.1.2.34 --- squid/src/ESI.c 29 Aug 2002 03:52:32 -0000 1.1.2.33 +++ squid/src/ESI.c 5 Sep 2002 07:38:04 -0000 1.1.2.34 @@ -1,6 +1,6 @@ /* - * $Id: ESI.c,v 1.1.2.33 2002/08/29 03:52:32 rbcollins Exp $ + * $Id: ESI.c,v 1.1.2.34 2002/09/05 07:38:04 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -2266,11 +2266,10 @@ char const *t; int len; t = index (s,'/'); - if (!t) + if (!t || !*(++t)) return xstrdup (""); len = strcspn (t, " \r\n()<>@,;:\\\"/[]?={}"); return xstrndup (t, len); - } esiVarState * @@ -2293,7 +2292,10 @@ rv->query_string = xstrdup (query_start + 1); rv->query_elements = 1; query_pos = query_start + 1; - while ((query_pos = strchr (query_pos, '&'))) ++rv->query_elements; + while ((query_pos = strchr (query_pos, '&'))) { + ++rv->query_elements; + ++query_pos; + } rv->query = memReallocBuf(rv->query, rv->query_elements * sizeof (struct _query_elem), &rv->query_sz); query_pos = query_start + 1; @@ -2301,6 +2303,8 @@ while (query_pos) { char *next = strchr (query_pos, '&'); char *div = strchr (query_pos, '='); + if (next) + ++next; assert (n < rv->query_elements); if (!div) div = next; @@ -2453,7 +2457,7 @@ while (strListGetItem(&header, separator, &item, &ilen, &pos)) { if (strncmp(item, member, mlen) == 0 - && (item[mlen] == '=' || item[mlen] == separator || item[mlen] == ';')) { + && (item[mlen] == '=' || item[mlen] == separator || item[mlen] == ';' || item[mlen] == '\0')) { result = 1; break; } Index: squid/src/client_side_request.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_request.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -r1.1.2.13 -r1.1.2.14 --- squid/src/client_side_request.c 29 Aug 2002 03:52:32 -0000 1.1.2.13 +++ squid/src/client_side_request.c 5 Sep 2002 07:38:05 -0000 1.1.2.14 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.c,v 1.1.2.13 2002/08/29 03:52:32 rbcollins Exp $ + * $Id: client_side_request.c,v 1.1.2.14 2002/09/05 07:38:05 rbcollins Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originall Duane Wessels in client_side.c) @@ -141,6 +141,9 @@ * TODO */ request->flags.accelerated = http->flags.accel; + request->flags.internalclient = 1; /* this is an internally created request, not subject + to acceleration target overrides + */ /* FIXME? Do we want to detect and handle internal requests of internal * objects ? */ Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -r1.16 -r1.16.2.1 --- squid/src/forward.c 21 Jun 2002 13:00:28 -0000 1.16 +++ squid/src/forward.c 5 Sep 2002 07:38:05 -0000 1.16.2.1 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.16 2002/06/21 13:00:28 squidadm Exp $ + * $Id: forward.c,v 1.16.2.1 2002/09/05 07:38:05 rbcollins Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -339,6 +339,7 @@ ctimeout = fs->peer->connect_timeout > 0 ? fs->peer->connect_timeout : Config.Timeout.peer_connect; } else if (fwdState->request->flags.accelerated && + !fwdState->request->flags.internalclient && Config.Accel.single_host && Config.Accel.host) { host = Config.Accel.host; port = Config.Accel.port; Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.61.2.11 retrieving revision 1.61.2.12 diff -u -r1.61.2.11 -r1.61.2.12 --- squid/src/structs.h 28 Aug 2002 06:11:31 -0000 1.61.2.11 +++ squid/src/structs.h 5 Sep 2002 07:38:05 -0000 1.61.2.12 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.61.2.11 2002/08/28 06:11:31 rbcollins Exp $ + * $Id: structs.h,v 1.61.2.12 2002/09/05 07:38:05 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1103,7 +1103,6 @@ unsigned int internal:1; unsigned int done_copying:1; unsigned int purging:1; - unsigned int esi:1; /* Invoke the ESI processor on the body */ } flags; struct { http_status status; @@ -1643,6 +1642,7 @@ #endif unsigned int accelerated:1; unsigned int internal:1; + unsigned int internalclient:1; unsigned int body_sent:1; unsigned int reset_tcp:1; };