--------------------- PatchSet 975 Date: 2000/12/21 12:51:00 Author: adri Branch: modio Tag: (none) Log: Again, I was smoking crack. We can't stop storeRelease() running if REQUEST_RELEASE Is set, because this is how an object is actually released *anyone* once its unlocked. stupid stupid adrian. Instead, I'm calling e->strelease in storeReleaseRequest() if the object is still in use (and it hasn't been requested anyway), and then later in storeRelease(). Its not perfect, since we're still going to call strelease more than once, but it'll do for the time being (and it now makes the cache behave itself again..) Members: src/store.c:1.2.2.11->1.2.2.12 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.2.2.11 retrieving revision 1.2.2.12 diff -u -r1.2.2.11 -r1.2.2.12 --- squid/src/store.c 20 Dec 2000 15:45:55 -0000 1.2.2.11 +++ squid/src/store.c 21 Dec 2000 12:51:00 -0000 1.2.2.12 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.2.2.11 2000/12/20 15:45:55 adri Exp $ + * $Id: store.c,v 1.2.2.12 2000/12/21 12:51:00 adri Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -249,6 +249,15 @@ * prevents httpMakePublic from really setting a public key. */ EBIT_CLR(e->flags, ENTRY_CACHABLE); + /* + * Notify the reply layer that we want this object released.. + * XXX an evil hack - this can be called before the reply object + * is attached. If this happens, don't try to notify the reply + * object. When the reply object is created by createNewStoreEntry + * we'll be ok. -- adrian + */ + if (e->strelease != NULL) + e->strelease(e); storeSetPrivateKey(e); } @@ -735,18 +744,9 @@ storeRelease(StoreEntry * e) { debug(20, 3) ("storeRelease: Releasing: '%s'\n", storeKeyText(e->hash.key)); - /* Don't do anything if we're already releasing ..*/ - if (EBIT_TEST(e->flags, RELEASE_REQUEST)) { - debug(20, 3) ("storeRelease: already releasing!\n"); - return; - } /* If, for any reason we can't discard this object because of an * outstanding request, mark it for pending release */ - - /* Notify the reply layer to release this object */ - e->strelease(e); - if (storeEntryLocked(e)) { storeExpireNow(e); debug(20, 3) ("storeRelease: Only setting RELEASE_REQUEST bit\n"); @@ -754,6 +754,9 @@ return; } + /* Notify the reply layer to release this object */ + e->strelease(e); + /* Time to deallocate the storeentry .. */ storeLog(STORE_LOG_RELEASE, e);