From 24ffafb48cef1a0c6bacf8a4f05b10787c5a502a Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 4 Nov 1997 06:18:16 +0000 Subject: [PATCH] new store key fixes --- src/protos.h | 1 + src/stat.cc | 8 ++++++-- src/store.cc | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/protos.h b/src/protos.h index 51369a4e2b..5da113aec0 100644 --- a/src/protos.h +++ b/src/protos.h @@ -460,6 +460,7 @@ extern void storeRegisterAbort(StoreEntry * e, STABH * cb, void *); extern void storeUnregisterAbort(StoreEntry * e); extern void storeMemObjectDump(MemObject * mem); extern const char *storeUrl(const StoreEntry *); +extern void storeCreateMemObject(StoreEntry *, const char *, const char *); /* storeKey stuff */ extern const cache_key *storeKeyDup(const cache_key *); diff --git a/src/stat.cc b/src/stat.cc index c5f3aff542..ef62a930c6 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.166 1997/11/03 22:43:20 wessels Exp $ + * $Id: stat.cc,v 1.167 1997/11/03 23:18:17 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -336,7 +336,9 @@ statObjects(StoreEntry * sentry, int vm_or_not) if ((++N & 0xFF) == 0) { debug(18, 3) ("stat_objects_get: Processed %d objects...\n", N); } - storeAppendPrintf(sentry, "%s %s\n", + BIT_SET(sentry->flag, DELAY_SENDING); + storeAppendPrintf(sentry, "KEY %s\n", storeKeyText(entry->key)); + storeAppendPrintf(sentry, "\t%s %s\n", RequestMethodStr[entry->method], storeUrl(entry)); storeAppendPrintf(sentry, "\t%s\n", describeStatuses(entry)); storeAppendPrintf(sentry, "\t%s\n", describeFlags(entry)); @@ -369,6 +371,8 @@ statObjects(StoreEntry * sentry, int vm_or_not) storeAppendPrintf(sentry, "\t\tswapin_fd: %d\n", (int) sc->swapin_fd); } + BIT_CLR(sentry->flag, DELAY_SENDING); + storeAppendPrintf(sentry, "\n"); } } diff --git a/src/store.cc b/src/store.cc index 65ca1dce5c..fde3fd6456 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.333 1997/11/03 22:43:22 wessels Exp $ + * $Id: store.cc,v 1.334 1997/11/03 23:18:18 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -1846,7 +1846,7 @@ storeInitHashValues(void) /* ideally the full scan period should be configurable, for the * moment it remains at approximately 24 hours. */ store_hash_buckets = storeKeyHashBuckets(i); - store_maintain_rate = store_hash_buckets / 86400; + store_maintain_rate = 86400 / store_hash_buckets; assert(store_maintain_rate > 0); debug(20, 1) ("Using %d Store buckets, maintain %d bucket%s every %d second%s\n", store_hash_buckets, @@ -2347,9 +2347,17 @@ const char * storeUrl(const StoreEntry * e) { if (e == NULL) - return "[null entry]"; + return "[null_entry]"; else if (e->mem_obj == NULL) - return "[null mem_obj]"; + return "[null_mem_obj]"; else return e->mem_obj->url; } + +void +storeCreateMemObject(StoreEntry * e, const char *url, const char *log_url) +{ + if (e->mem_obj) + return; + e->mem_obj = new_MemObject(url, log_url); +} -- 2.47.2