/*
- * $Id: Store.h,v 1.17 2006/01/23 20:04:24 wessels Exp $
+ * $Id: Store.h,v 1.18 2006/03/02 20:46:03 wessels Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
virtual bool swapoutPossible();
virtual void trimMemory();
void unlink();
+ void makePublic();
+ void makePrivate();
+ void cacheNegatively();
void delayAwareRead(int fd, char *buf, int len, IOCB *handler, void *data);
/*
- * $Id: http.cc,v 1.488 2006/02/21 23:52:08 wessels Exp $
+ * $Id: http.cc,v 1.489 2006/03/02 20:46:03 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
static PF httpStateFree;
static PF httpTimeout;
-static void httpCacheNegatively(StoreEntry *);
-static void httpMakePrivate(StoreEntry *);
-static void httpMakePublic(StoreEntry *);
static void httpMaybeRemovePublic(StoreEntry *, http_status);
static void copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, String strConnection, HttpRequest * request, HttpRequest * orig_request,
HttpHeader * hdr_out, int we_do_ranges, http_state_flags);
comm_close(fd);
}
-/* This object can be cached for a long time */
-static void
-httpMakePublic(StoreEntry * entry)
-{
- if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
- storeSetPublicKey(entry);
-}
-
-/* This object should never be cached at all */
-static void
-httpMakePrivate(StoreEntry * entry)
-{
- storeExpireNow(entry);
- storeReleaseRequest(entry); /* delete object when not used */
- /* storeReleaseRequest clears ENTRY_CACHABLE flag */
-}
-
-/* This object may be negatively cached */
-static void
-httpCacheNegatively(StoreEntry * entry)
-{
- storeNegativeCache(entry);
-
- if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
- storeSetPublicKey(entry);
-}
-
static void
httpMaybeRemovePublic(StoreEntry * e, http_status status)
{
(Config.onoff.surrogate_is_remote
&& EBIT_TEST(sctusable->mask, SC_NO_STORE_REMOTE))) {
surrogateNoStore = true;
- httpMakePrivate(entry);
+ entry->makePrivate();
}
/* The HttpHeader logic cannot tell if the header it's parsing is a reply to an
const char *vary = httpMakeVaryMark(orig_request, getReply());
if (!vary) {
- httpMakePrivate(entry);
+ entry->makePrivate();
goto no_cache;
}
switch (cacheableReply()) {
case 1:
- httpMakePublic(entry);
+ entry->makePublic();
break;
case 0:
- httpMakePrivate(entry);
+ entry->makePrivate();
break;
case -1:
if (Config.negativeTtl > 0)
- httpCacheNegatively(entry);
+ entry->cacheNegatively();
else
- httpMakePrivate(entry);
+ entry->makePrivate();
break;
/*
- * $Id: store.cc,v 1.584 2006/02/17 20:15:35 wessels Exp $
+ * $Id: store.cc,v 1.585 2006/03/02 20:46:02 wessels Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
pool->free(address);
}
+void
+StoreEntry::makePublic()
+{
+ /* This object can be cached for a long time */
+
+ if (EBIT_TEST(flags, ENTRY_CACHABLE))
+ storeSetPublicKey(this);
+}
+
+void
+StoreEntry::makePrivate()
+{
+ /* This object should never be cached at all */
+ storeExpireNow(this);
+ storeReleaseRequest(this); /* delete object when not used */
+ /* storeReleaseRequest clears ENTRY_CACHABLE flag */
+}
+
+void
+StoreEntry::cacheNegatively()
+{
+ /* This object may be negatively cached */
+ storeNegativeCache(this);
+
+ if (EBIT_TEST(flags, ENTRY_CACHABLE))
+ storeSetPublicKey(this);
+}
+
size_t
StoreEntry::inUseCount()
{