]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
further safegurads in httpMaybeRemovePublic. return if the key
authorwessels <>
Fri, 11 Sep 1998 01:48:55 +0000 (01:48 +0000)
committerwessels <>
Fri, 11 Sep 1998 01:48:55 +0000 (01:48 +0000)
is PUBLIC, and assert that we don't remove the "current" entry.

src/http.cc

index 720574c0fd2885e9935332abeeedd5ce039c97b7..73b0bfd7e5b199338ca2f3e9de5a9a63cf572c4d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.315 1998/09/10 19:45:53 wessels Exp $
+ * $Id: http.cc,v 1.316 1998/09/10 19:48:55 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -134,6 +134,8 @@ httpMaybeRemovePublic(StoreEntry * e, http_status status)
     int remove = 0;
     const cache_key *key;
     StoreEntry *pe;
+    if (!EBIT_TEST(e->flag, KEY_PRIVATE))
+       return;
     switch (status) {
     case HTTP_OK:
     case HTTP_NON_AUTHORITATIVE_INFORMATION:
@@ -161,6 +163,7 @@ httpMaybeRemovePublic(StoreEntry * e, http_status status)
     key = storeKeyPublic(e->mem_obj->url, e->mem_obj->method);
     if ((pe = storeGet(key)) == NULL)
        return;
+    assert(e != pe);
     storeRelease(pe);
 }