/*
- * $Id: store.cc,v 1.274 1997/07/16 20:32:19 wessels Exp $
+ * $Id: store.cc,v 1.275 1997/07/16 22:57:24 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
time_t,
time_t,
time_t,
+ time_t,
u_num32,
u_num32,
int));
/* Add a new object to the cache with empty memory copy and pointer to disk
* use to rebuild store from disk. */
static StoreEntry *
-storeAddDiskRestore(const char *url, int file_number, int size, time_t expires, time_t timestamp, time_t lastmod, u_num32 refcount, u_num32 flags, int clean)
+storeAddDiskRestore(const char *url,
+ int file_number,
+ int size,
+ time_t expires,
+ time_t timestamp,
+ time_t lastref,
+ time_t lastmod,
+ u_num32 refcount,
+ u_num32 flags,
+ int clean)
{
StoreEntry *e = NULL;
debug(20, 5) ("StoreAddDiskRestore: %s, fileno=%08X\n", url, file_number);
e->object_len = size;
e->lock_count = 0;
e->refcount = 0;
- e->lastref = timestamp;
+ e->lastref = lastref;
e->timestamp = timestamp;
e->expires = expires;
e->lastmod = lastmod;
StoreEntry *e = NULL;
time_t expires;
time_t timestamp;
+ time_t lastref;
time_t lastmod;
int scan1;
int scan2;
int scan4;
int scan5;
int scan6;
+ int scan7;
off_t size;
int sfileno = 0;
int count;
scan2 = 0;
scan3 = 0;
scan4 = 0;
- x = sscanf(RB->line_in, "%x %x %x %x %d %d %x %s",
+ scan5 = 0;
+ scan6 = 0;
+ scan7 = 0;
+ x = sscanf(RB->line_in, "%x %x %x %x %x %d %d %x %s",
&sfileno, /* swap_file_number */
&scan1, /* timestamp */
- &scan2, /* expires */
- &scan3, /* last modified */
- &scan4, /* size */
- &scan5, /* refcount */
- &scan6, /* flags */
+ &scan2, /* lastref */
+ &scan3, /* expires */
+ &scan4, /* last modified */
+ &scan5, /* size */
+ &scan6, /* refcount */
+ &scan7, /* flags */
url); /* url */
if (x < 1) {
RB->invalid++;
continue;
}
storeSwapFullPath(sfileno, swapfile);
- if (x != 8) {
+ if (x != 9) {
RB->invalid++;
continue;
}
RB->invalid++;
continue;
}
- if (BIT_TEST(scan6, KEY_PRIVATE)) {
+ if (BIT_TEST(scan7, KEY_PRIVATE)) {
RB->badflags++;
continue;
}
sfileno = storeDirProperFileno(d->dirn, sfileno);
timestamp = (time_t) scan1;
- expires = (time_t) scan2;
- lastmod = (time_t) scan3;
- size = (off_t) scan4;
+ lastref = (time_t) scan2;
+ expires = (time_t) scan3;
+ lastmod = (time_t) scan4;
+ size = (off_t) scan5;
e = storeGet(url);
used = storeDirMapBitTest(sfileno);
e->timestamp = timestamp;
e->expires = expires;
e->lastmod = lastmod;
- e->flag |= (u_num32) scan5;
- e->refcount += (u_num32) scan6;
+ e->flag |= (u_num32) scan6;
+ e->refcount += (u_num32) scan7;
continue;
} else if (used) {
/* swapfile in use, not by this URL, log entry is newer */
(int) size,
expires,
timestamp,
+ lastref,
lastmod,
- (u_num32) scan5, /* refcount */
- (u_num32) scan6, /* flags */
+ (u_num32) scan6, /* refcount */
+ (u_num32) scan7, /* flags */
d->clean);
storeDirSwapLog(e);
HTTPCacheInfo->proto_newobject(HTTPCacheInfo,
i = 3;
if (sm_stats.n_pages_in_use > store_pages_max) {
- if (sm_stats.n_pages_in_use > last_warning * 1.05) {
+ if (sm_stats.n_pages_in_use > last_warning * 1.10) {
debug(20, 0) ("WARNING: Exceeded 'cache_mem' size (%dK > %dK)\n",
sm_stats.n_pages_in_use * 4, store_pages_max * 4);
last_warning = sm_stats.n_pages_in_use;
assert(dirn < Config.cacheSwap.n_configured);
if (fd[dirn] < 0)
continue;
- sprintf(line, "%08x %08x %08x %08x %9d %6d %08x %s\n",
+ sprintf(line, "%08x %08x %08x %08x %08x %9d %6d %08x %s\n",
(int) e->swap_file_number,
(int) e->timestamp,
+ (int) e->lastref,
(int) e->expires,
(int) e->lastmod,
e->object_len,
xfree(list);
hashFreeMemory(store_table);
safe_free(MaintBucketsOrder);
- storeDirCloseSwapLogs();
}
int
/*
- * $Id: store_dir.cc,v 1.25 1997/07/16 20:58:25 wessels Exp $
+ * $Id: store_dir.cc,v 1.26 1997/07/16 22:57:25 wessels Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
fatal_dump("storeDirSwapLog: swap_file_number < 0");
dirn = e->swap_file_number >> SWAP_DIR_SHIFT;
assert(dirn < Config.cacheSwap.n_configured);
+ if (BIT_TEST(e->flag, KEY_PRIVATE))
+ debug(0,0)("storeDirSwapLog: PRIVATE: %s\n", e->url);
/* Note this printf format appears in storeWriteCleanLog() too */
- sprintf(logmsg, "%08x %08x %08x %08x %9d %6d %08x %s\n",
+ sprintf(logmsg, "%08x %08x %08x %08x %08x %9d %6d %08x %s\n",
(int) e->swap_file_number,
(int) e->timestamp,
+ (int) e->lastref,
(int) e->expires,
(int) e->lastmod,
e->object_len,