]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL2.rebuild_release.patch
authorhno <>
Wed, 3 May 2000 02:07:37 +0000 (02:07 +0000)
committerhno <>
Wed, 3 May 2000 02:07:37 +0000 (02:07 +0000)
Squid-2.3.DEVEL2: Release unused store entries during rebuild

Squid locked all "released" store entries in memory during the rebuild
procedure, even such entries not needed in the "LateRelease" procedure.
Also, during a dirty rebuild a lot of store entries got locked up which
never was queued for "LateRelease", causing a huge memory leak.

src/store.cc

index a3278bff8651aa996557a42480e6ee9b978ee467..d7b1666f23ea587e7f347553588033c21f936339 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.517 2000/05/02 18:49:26 hno Exp $
+ * $Id: store.cc,v 1.518 2000/05/02 20:07:37 hno Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -964,15 +964,18 @@ storeRelease(StoreEntry * e)
            storeSetMemStatus(e, NOT_IN_MEMORY);
            destroy_MemObject(e);
        }
-       /*
-        * Fake a call to storeLockObject().  When rebuilding is done,
-        * we'll just call storeUnlockObject() on these.
-        */
-       e->lock_count++;
-       EBIT_SET(e->flags, RELEASE_REQUEST);
-       stackPush(&LateReleaseStack, e);
-       return;
-    }
+       if (e->swap_file_number > -1) {
+           /*
+            * Fake a call to storeLockObject().  When rebuilding is done,
+            * we'll just call storeUnlockObject() on these.
+            */
+           e->lock_count++;
+           EBIT_SET(e->flags, RELEASE_REQUEST);
+           stackPush(&LateReleaseStack, e);
+           return;
+       } else {
+           destroy_StoreEntry(e);
+       }
     storeLog(STORE_LOG_RELEASE, e);
     if (e->swap_file_number > -1) {
        storeUnlink(e->swap_file_number);