]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL2.ipcache_reload.patch
authorhno <>
Wed, 3 May 2000 02:18:21 +0000 (02:18 +0000)
committerhno <>
Wed, 3 May 2000 02:18:21 +0000 (02:18 +0000)
Squid-2.3.DEVEL2: Purge ipcache on reload/PURGE

Purge negatively cached ipcache entries on reload to allow end users to
quickly purge sporious errors, and have the PURGE method also purge
ipcache to allow the cache administrator to manually purge important
entries on DNS updates.

ChangeLog
src/client_side.cc

index 21fed316bcfd712235ec3164646ee1555a22ee70..c3c62597ae16bb672ab2e4d260eb26eb2dd073f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,8 @@ Changes to Squid-2.4.DEVEL3 ():
        - Fixed a StoreEntry memory leak during "dirty" rebuild
        - Helper processes no longer hold unrelated filedescriptors open
        - Helpers are now restarted when the logs are rotated
+       - Negatively cached DNS entries are now purged on "reload".
+       - PURGE now also purges the DNS cache
 
 Changes to Squid-2.4.DEVEL2 ():
 
index 49068310d2aff8e2901cc4796931e5f4a7a7f844..56bf036de94342f8e674747c318c3aea733ed925 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.476 2000/05/02 19:53:53 hno Exp $
+ * $Id: client_side.cc,v 1.477 2000/05/02 20:18:21 hno Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -569,6 +569,8 @@ clientPurgeRequest(clientHttpRequest * http)
        return;
     }
     http->log_type = LOG_TCP_MISS;
+    /* Release both IP and object cache entries */
+    ipcacheInvalidate(http->request->host);
     if ((entry = storeGetPublic(http->uri, METHOD_GET)) == NULL) {
        http->http_code = HTTP_NOT_FOUND;
     } else {
@@ -1882,6 +1884,13 @@ clientProcessRequest2(clientHttpRequest * http)
        /* We can generate a HEAD reply from a cached GET object */
        e = http->entry = storeGetPublic(http->uri, METHOD_GET);
     }
+    /* Release negatively cached IP-cache entries on reload */
+    if (r->flags.nocache)
+       ipcacheReleaseInvalid(r->host);
+#if HTTP_VIOLATIONS
+    else if (r->flags.nocache_hack)
+       ipcacheReleaseInvalid(r->host);
+#endif
 #if USE_CACHE_DIGESTS
     http->lookup_type = e ? "HIT" : "MISS";
 #endif
@@ -1907,12 +1916,6 @@ clientProcessRequest2(clientHttpRequest * http)
        return LOG_TCP_HIT;
     }
 #if HTTP_VIOLATIONS
-    if (r->flags.nocache_hack) {
-       /* if nocache_hack is set, nocache should always be clear, right? */
-       assert(!r->flags.nocache);
-       ipcacheReleaseInvalid(r->host);
-       /* continue! */
-    }
     if (e->store_status == STORE_PENDING) {
        if (r->flags.nocache || r->flags.nocache_hack) {
            debug(33, 3) ("Clearing no-cache for STORE_PENDING request\n\t%s\n",