]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
new store key fixes
authorwessels <>
Tue, 4 Nov 1997 06:18:16 +0000 (06:18 +0000)
committerwessels <>
Tue, 4 Nov 1997 06:18:16 +0000 (06:18 +0000)
src/protos.h
src/stat.cc
src/store.cc

index 51369a4e2b421c145c0b99e72eceb674ef5da4e4..5da113aec0d188db0ebbbcd754868bae18bba2f3 100644 (file)
@@ -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 *);
index c5f3aff542a3e4eabe674ef959b17453b34dfe7e..ef62a930c69b3c1148b5217225f7292030599119 100644 (file)
@@ -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");
     }
 }
 
index 65ca1dce5cfa4f7d17bff3f194aeaf9f940a5a67..fde3fd645622554c08697db8bfac50f3fb01cbe0 100644 (file)
@@ -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);
+}