Patch to make Reload into IMS work more sanely

From: Stewart Forster <slf@dont-contact.us>
Date: Fri, 14 Aug 1998 12:39:20 +1000

Hiya,

        Discovered that the reload_into_ims code didn't do anything more
than turn the REQ_NOCACHE bit into something that's not used. That was
bad because it meant that if an object hadn't reached its refresh timeout,
then Squid would not bother to try and revalidate it. This meant that
users doing a shift-reload on their browser couldn't even get the cache
to at least do an IMS lookup if the cache didn't believe the object had
expired. That's a breaking the no-cache tag a little too enthusiastically.

The following patches do some cosmetic changes (REQ_NOCACHE_HACK ->
REQ_NOCACHE_IMS), and introduce a new check into refreshCheck to force an
IMS refresh check if REQ_NOCACHE_IMS is set.

        The patch set is generated against 1.2beta24 PL 4 base.

        Stew.

--- enums.h 1998/08/14 01:57:12 1.1
+++ enums.h 1998/08/14 01:57:28
@@ -511,7 +511,7 @@
     REQ_REFRESH,
     REQ_USED_PROXY_AUTH,
     REQ_REDIRECTED,
- REQ_NOCACHE_HACK /* for changing no-cache requests into IMS */
+ REQ_NOCACHE_IMS /* for changing no-cache requests into IMS */
 };
 
 enum {
--- refresh.c 1998/08/14 02:16:18 1.1
+++ refresh.c 1998/08/14 02:28:56
@@ -112,6 +112,11 @@
     refreshCounts.total++;
     if (EBIT_TEST(entry->flag, ENTRY_REVALIDATE)) {
         debug(22, 3) ("refreshCheck: YES: Required Authorization\n");
+ refreshCounts.revalidate_stale++;
+ return 1;
+ }
+ if (EBIT_TEST(request->flags, REQ_NOCACHE_IMS)) {
+ debug(22, 3) ("refreshCheck: YES: Reload into IMS\n");
         refreshCounts.revalidate_stale++;
         return 1;
     }
--- client_side.c 1998/08/14 01:54:03 1.1
+++ client_side.c 1998/08/14 02:14:50
@@ -674,7 +674,7 @@
             if (!Config.onoff.reload_into_ims)
                 EBIT_SET(request->flags, REQ_NOCACHE);
             else
- EBIT_SET(request->flags, REQ_NOCACHE_HACK);
+ EBIT_SET(request->flags, REQ_NOCACHE_IMS);
         }
         stringClean(&s);
     }
Received on Tue Jul 29 2003 - 13:15:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:50 MST