---------------------
PatchSet 4806
Date: 2002/08/29 03:52:31
Author: rbcollins
Branch: esi
Tag: (none)
Log:
implement client cache-control ignoring, and add some debug to includes
Members:
configure.in:1.61.2.4->1.61.2.5
doc/debug-sections.txt:1.5.2.1->1.5.2.2
errors/English/ERR_ESI:1.1.2.1->1.1.2.2
src/ESI.c:1.1.2.32->1.1.2.33
src/client_side_request.c:1.1.2.12->1.1.2.13
Index: squid/configure.in
===================================================================
RCS file: /cvsroot/squid-sf//squid/configure.in,v
retrieving revision 1.61.2.4
retrieving revision 1.61.2.5
diff -u -r1.61.2.4 -r1.61.2.5
--- squid/configure.in 25 Aug 2002 08:59:00 -0000 1.61.2.4
+++ squid/configure.in 29 Aug 2002 03:52:31 -0000 1.61.2.5
@@ -3,7 +3,7 @@
dnl
dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
dnl
-dnl $Id: configure.in,v 1.61.2.4 2002/08/25 08:59:00 rbcollins Exp $
+dnl $Id: configure.in,v 1.61.2.5 2002/08/29 03:52:31 rbcollins Exp $
dnl
dnl
dnl
@@ -11,7 +11,7 @@
AC_CONFIG_AUX_DIR(cfgaux)
AM_INIT_AUTOMAKE(squid, 2.6-DEVEL)
AM_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.61.2.4 $)dnl
+AC_REVISION($Revision: 1.61.2.5 $)dnl
AC_PREFIX_DEFAULT(/usr/local/squid)
AM_MAINTAINER_MODE
@@ -462,7 +462,7 @@
AM_CONDITIONAL(USE_ESI, false)
AC_ARG_ENABLE(esi,
- AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat]),
+ AC_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat. Enabling ESI will cause squid to follow the Edge Acceleration Specification (www.esi.org). This causes squid to IGNORE client Cache-Control headers. DO NOT use this in a squid configured as a web proxy, ONLY use it in a squid configured for webserver acceleration.]),
ac_cv_use_esi=$enableval, ac_cv_use_esi=no)
AC_CACHE_CHECK(whether to enable ESI,ac_cv_use_esi, ac_cv_use_esi=no)
if test "$ac_cv_use_esi" = "yes" ; then
Index: squid/doc/debug-sections.txt
===================================================================
RCS file: /cvsroot/squid-sf//squid/doc/debug-sections.txt,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- squid/doc/debug-sections.txt 11 Aug 2002 10:08:22 -0000 1.5.2.1
+++ squid/doc/debug-sections.txt 29 Aug 2002 03:52:31 -0000 1.5.2.2
@@ -92,3 +92,4 @@
section 86 ESI processing
section 87 client side stream management
section 88 Client side reply management - from store to stream
+section 89 Http Surrogate-Control Header
Index: squid/errors/English/ERR_ESI
===================================================================
RCS file: /cvsroot/squid-sf//squid/errors/English/Attic/ERR_ESI,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- squid/errors/English/ERR_ESI 25 Aug 2002 08:59:01 -0000 1.1.2.1
+++ squid/errors/English/ERR_ESI 29 Aug 2002 03:52:32 -0000 1.1.2.2
@@ -1,7 +1,7 @@
ERROR: The requested URL could not be retrieved
-
+
The requested URL could not be retrieved
Index: squid/src/ESI.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/src/Attic/ESI.c,v
retrieving revision 1.1.2.32
retrieving revision 1.1.2.33
diff -u -r1.1.2.32 -r1.1.2.33
--- squid/src/ESI.c 28 Aug 2002 06:11:30 -0000 1.1.2.32
+++ squid/src/ESI.c 29 Aug 2002 03:52:32 -0000 1.1.2.33
@@ -1,6 +1,6 @@
/*
- * $Id: ESI.c,v 1.1.2.32 2002/08/28 06:11:30 rbcollins Exp $
+ * $Id: ESI.c,v 1.1.2.33 2002/08/29 03:52:32 rbcollins Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
@@ -1977,6 +1977,7 @@
if (stream == this->src) {
if (success) {
/* copy the lead segment */
+ debug (86,3)("esiIncludeSubRequestDone: Src OK - include PASSED.\n");
this->srccontent = cbdataAlloc (esiSegment);
xmemcpy (this->srccontent->buf, stream->localbuffer.buf, stream->localbuffer.len);
this->srccontent->len = stream->localbuffer.len;
@@ -1986,9 +1987,12 @@
this->flags.finished = 1;
} else {
/* Fail if there is no alt being retrieved */
+ debug (86,3)("esiIncludeSubRequestDone: Src FAILED\n");
if (!(this->alt || this->altcontent)) {
+ debug (86,3)("esiIncludeSubRequestDone: Include FAILED - No ALT\n");
this->flags.failed = 1;
} else if (this->altcontent) {
+ debug (86,3)("esiIncludeSubRequestDone: Include PASSED - ALT already Complete\n");
/* ALT was already retrieved, we are done */
this->flags.finished = 1;
}
@@ -1996,6 +2000,7 @@
this->src = NULL;
} else if (stream == this->alt) {
if (success) {
+ debug (86,3)("esiIncludeSubRequestDone: ALT OK.\n");
/* copy the lead segment */
this->altcontent = cbdataAlloc (esiSegment);
xmemcpy (this->altcontent->buf, stream->localbuffer.buf, stream->localbuffer.len);
@@ -2005,10 +2010,12 @@
/* we're done! */
if (!(this->src || this->srccontent)) {
/* src already failed, kick ESI processor */
+ debug (86,3)("esiIncludeSubRequestDone: Include PASSED - SRC already failed.\n");
this->flags.finished = 1;
}
} else {
if (!(this->src || this->srccontent)) {
+ debug (86,3)("esiIncludeSubRequestDone: ALT FAILED, Include FAILED - SRC already failed\n");
/* src already failed */
this->flags.failed = 1;
}
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.12
retrieving revision 1.1.2.13
diff -u -r1.1.2.12 -r1.1.2.13
--- squid/src/client_side_request.c 28 Aug 2002 07:10:00 -0000 1.1.2.12
+++ squid/src/client_side_request.c 29 Aug 2002 03:52:32 -0000 1.1.2.13
@@ -1,6 +1,6 @@
/*
- * $Id: client_side_request.c,v 1.1.2.12 2002/08/28 07:10:00 rbcollins Exp $
+ * $Id: client_side_request.c,v 1.1.2.13 2002/08/29 03:52:32 rbcollins Exp $
*
* DEBUG: section 85 Client-side Request Routines
* AUTHOR: Robert Collins (Originall Duane Wessels in client_side.c)
@@ -353,11 +353,18 @@
request_t *request = http->request;
const HttpHeader *req_hdr = &request->header;
int no_cache = 0;
+#if !defined(ESI) || defined(USE_USERAGENT_LOG) || defined(USE_REFERER_LOG)
const char *str;
+#endif
request->imslen = -1;
request->ims = httpHeaderGetTime(req_hdr, HDR_IF_MODIFIED_SINCE);
if (request->ims > 0)
request->flags.ims = 1;
+#if ESI
+ /* We ignore Cache-Control as per the Edge Architecture
+ * Section 3. See www.esi.org for more information.
+ */
+#else
if (httpHeaderHas(req_hdr, HDR_PRAGMA)) {
String s = httpHeaderGetList(req_hdr, HDR_PRAGMA);
if (strListIsMember(&s, "no-cache", ','))
@@ -389,6 +396,7 @@
}
}
}
+#endif
if (no_cache) {
#if HTTP_VIOLATIONS
if (Config.onoff.reload_into_ims)