From: hno <> Date: Wed, 3 May 2000 02:18:21 +0000 (+0000) Subject: hno squid-2.3.DEVEL2.ipcache_reload.patch X-Git-Tag: SQUID_3_0_PRE1~2014 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afc1e43fa1af0fafc48166884c51d4346a6c5fa3;p=thirdparty%2Fsquid.git hno squid-2.3.DEVEL2.ipcache_reload.patch 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. --- diff --git a/ChangeLog b/ChangeLog index 21fed316bc..c3c62597ae 100644 --- 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 (): diff --git a/src/client_side.cc b/src/client_side.cc index 49068310d2..56bf036de9 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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",