From: wessels <> Date: Tue, 15 Jul 1997 10:03:09 +0000 (+0000) Subject: - memset needs to go LAST in comm_close() X-Git-Tag: SQUID_3_0_PRE1~4888 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=994bbf9308294d52445a21f72925f753ac158e4a;p=thirdparty%2Fsquid.git - memset needs to go LAST in comm_close() - Count invalid during store rebuild. - storeWriteCleanLog() was using the old swaplog format. --- diff --git a/src/comm.cc b/src/comm.cc index 6dd2630a71..b0322ccc30 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.177 1997/07/15 02:30:17 wessels Exp $ + * $Id: comm.cc,v 1.178 1997/07/15 04:03:09 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -580,7 +580,6 @@ comm_close(int fd) return; } assert(F->type != FD_FILE); - memset(F, '\0', sizeof(fde)); CommWriteStateCallbackAndFree(fd, COMM_ERROR); commCallCloseHandlers(fd); fd_close(fd); /* update fdstat */ @@ -589,6 +588,7 @@ comm_close(int fd) #else close(fd); #endif + memset(F, '\0', sizeof(fde)); } diff --git a/src/store.cc b/src/store.cc index 135c4c5143..5821235261 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.270 1997/07/15 03:29:05 wessels Exp $ + * $Id: store.cc,v 1.271 1997/07/15 04:03:11 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -196,6 +196,7 @@ struct storeRebuildState { int linecount; /* # lines parsed from cache logfile */ int clashcount; /* # swapfile clashes avoided */ int dupcount; /* # duplicates purged */ + int invalid; /* # bad lines */ int need_to_validate; time_t start; time_t stop; @@ -1329,13 +1330,19 @@ storeDoRebuildFromDisk(void *data) &scan5, /* refcount */ &scan6, /* flags */ url); /* url */ - if (x < 1) + if (x < 1) { + RB->invalid++; continue; + } storeSwapFullPath(sfileno, swapfile); - if (x != 8) + if (x != 8) { + RB->invalid++; continue; - if (sfileno < 0) + } + if (sfileno < 0) { + RB->invalid++; continue; + } sfileno = storeDirProperFileno(d->dirn, sfileno); timestamp = (time_t) scan1; expires = (time_t) scan2; @@ -1543,6 +1550,7 @@ storeRebuiltFromDisk(struct storeRebuildState *data) r = stop - data->start; debug(20, 1) ("Finished rebuilding storage from disk image.\n"); debug(20, 1) (" %7d Lines read from previous logfile.\n", data->linecount); + debug(20, 1) (" %7d Invalid lines.\n", data->invalid); debug(20, 1) (" %7d Objects loaded.\n", data->objcount); debug(20, 1) (" %7d Objects expired.\n", data->expcount); debug(20, 1) (" %7d Duplicate URLs purged.\n", data->dupcount); @@ -2435,12 +2443,14 @@ storeWriteCleanLogs(void) assert(dirn < Config.cacheSwap.n_configured); if (fd[dirn] < 0) continue; - sprintf(line, "%08x %08x %08x %08x %9d %s\n", + sprintf(line, "%08x %08x %08x %08x %9d %6d %08x %s\n", (int) e->swap_file_number, (int) e->timestamp, (int) e->expires, (int) e->lastmod, e->object_len, + e->refcount, + e->flag, e->url); if (write(fd[dirn], line, strlen(line)) < 0) { debug(50, 0) ("storeWriteCleanLogs: %s: %s\n", new[dirn], xstrerror());