From: wessels <> Date: Fri, 8 Nov 1996 03:52:49 +0000 (+0000) Subject: - Resurrected storeValidToSend() X-Git-Tag: SQUID_3_0_PRE1~5503 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe54d06dcb19799522e016fc4c74c6f60bac9a78;p=thirdparty%2Fsquid.git - Resurrected storeValidToSend() - Moved storeSetPrivateKey() to storeReleaseRequest(). --- diff --git a/src/ftp.cc b/src/ftp.cc index ba442f7021..6c772f295f 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.77 1996/11/06 23:14:34 wessels Exp $ + * $Id: ftp.cc,v 1.78 1996/11/07 20:52:49 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -255,7 +255,6 @@ ftpProcessReplyHeader(FtpStateData * data, const char *buf, int size) case 401: /* Unauthorized */ case 407: /* Proxy Authentication Required */ /* These should never be cached at all */ - storeSetPrivateKey(entry); storeExpireNow(entry); BIT_RESET(entry->flag, ENTRY_CACHABLE); storeReleaseRequest(entry); diff --git a/src/http.cc b/src/http.cc index f2522b4e8b..cf17c7825f 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.99 1996/11/07 18:53:15 wessels Exp $ + * $Id: http.cc,v 1.100 1996/11/07 20:52:50 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -226,7 +226,6 @@ httpMakePublic(StoreEntry * entry) static void httpMakePrivate(StoreEntry * entry) { - storeSetPrivateKey(entry); storeExpireNow(entry); BIT_RESET(entry->flag, ENTRY_CACHABLE); storeReleaseRequest(entry); /* delete object when not used */ diff --git a/src/store.cc b/src/store.cc index 78b5dd9a14..a884050f51 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.155 1996/11/07 18:53:18 wessels Exp $ + * $Id: store.cc,v 1.156 1996/11/07 20:52:52 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -237,6 +237,7 @@ static void storeSwapLog _PARAMS((const StoreEntry *)); static void storeSwapOutHandle _PARAMS((int, int, StoreEntry *)); static void storeHashMemInsert _PARAMS((StoreEntry *)); static void storeHashMemDelete _PARAMS((StoreEntry *)); +static void storeSetPrivateKey _PARAMS((StoreEntry *)); /* Now, this table is inaccessible to outsider. They have to use a method * to access a value in internal storage data structure. */ @@ -567,6 +568,7 @@ storeReleaseRequest(StoreEntry * e) } debug(20, 3, "storeReleaseRequest: FOR '%s'\n", e->key ? e->key : e->url); e->flag |= RELEASE_REQUEST; + storeSetPrivateKey(e); } /* unlock object, return -1 if object get released after unlock @@ -671,7 +673,7 @@ storeGeneratePublicKey(const char *url, method_t method) return NULL; } -void +static void storeSetPrivateKey(StoreEntry * e) { StoreEntry *e2 = NULL; @@ -2809,3 +2811,17 @@ expiresMoreThan(time_t expires, time_t when) return 0; return (expires > squid_curtime + when); } + +int +storeEntryValidToSend(StoreEntry * e) +{ + if (BIT_TEST(e->flag, RELEASE_REQUEST)) + return 0; + if (BIT_TEST(e->flag, ENTRY_NEGCACHED)) + if (entry->expires <= squid_curtime) + return 0; + if (e->store_status == STORE_ABORTED) + return 0; + return 1; +} +