From: wessels <> Date: Sat, 26 Apr 1997 04:01:16 +0000 (+0000) Subject: gindent X-Git-Tag: SQUID_3_0_PRE1~5049 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e3475136becdc3acd64116820059869b4300949;p=thirdparty%2Fsquid.git gindent --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 886d7a4599..8f15e3c194 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.179 1997/04/25 21:43:56 wessels Exp $ + * $Id: cache_cf.cc,v 1.180 1997/04/25 22:01:16 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -110,7 +110,7 @@ struct SquidConfig Config; #define DefaultMemMaxSize (8 << 20) /* 8 MB */ #define DefaultMemHighWaterMark 90 /* 90% */ #define DefaultMemLowWaterMark 75 /* 75% */ -#define DefaultSwapMaxSize 0 +#define DefaultSwapMaxSize 0 #define DefaultSwapHighWaterMark 95 /* 95% */ #define DefaultSwapLowWaterMark 90 /* 90% */ #define DefaultNetdbHigh 1000 /* counts, not percents */ @@ -858,7 +858,7 @@ parseCacheDir(void) self_destruct(); dir = token; GetInteger(i); - size = i << 10; /* Mbytes to kbytes */ + size = i << 10; /* Mbytes to kbytes */ Config.Swap.maxSize += size; GetInteger(i); l1 = i; diff --git a/src/store.cc b/src/store.cc index 9112902682..98a1510ed5 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.220 1997/04/25 21:43:59 wessels Exp $ + * $Id: store.cc,v 1.221 1997/04/25 22:01:18 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -188,11 +188,11 @@ const char *swapStatusStr[] = struct storeRebuildState { struct _rebuild_dir { int dirn; - FILE *log; + FILE *log; int speed; int clean; struct _rebuild_dir *next; - } *rebuild_dir; + } *rebuild_dir; int objcount; /* # objects successfully reloaded */ int expcount; /* # objects expired */ int linecount; /* # lines parsed from cache logfile */ @@ -884,9 +884,9 @@ storeAddDiskRestore(const char *url, int file_number, int size, time_t expires, e->lastmod = lastmod; e->ping_status = PING_NONE; if (store_rebuilding == STORE_REBUILDING_CLEAN) - BIT_SET(e->flag, ENTRY_VALIDATED); - else - BIT_RESET(e->flag, ENTRY_VALIDATED); + BIT_SET(e->flag, ENTRY_VALIDATED); + else + BIT_RESET(e->flag, ENTRY_VALIDATED); return e; } @@ -1400,19 +1400,19 @@ storeDoRebuildFromDisk(void *data) struct _rebuild_dir **D; /* load a number of objects per invocation */ if ((d = RB->rebuild_dir) == NULL) { - storeRebuiltFromDisk(RB); - return; + storeRebuiltFromDisk(RB); + return; } for (count = 0; count < d->speed; count++) { if (fgets(RB->line_in, RB->line_in_sz, d->log) == NULL) { - debug(20,1,"Done reading Cache Dir #%d swap log\n", d->dirn); - fclose(d->log); - d->log = NULL; - storeDirCloseTmpSwapLog(d->dirn); - RB->rebuild_dir = d->next; - safe_free(d); - eventAdd("storeRebuild", storeDoRebuildFromDisk, RB, 0); - return; + debug(20, 1, "Done reading Cache Dir #%d swap log\n", d->dirn); + fclose(d->log); + d->log = NULL; + storeDirCloseTmpSwapLog(d->dirn); + RB->rebuild_dir = d->next; + safe_free(d); + eventAdd("storeRebuild", storeDoRebuildFromDisk, RB, 0); + return; } if ((++RB->linecount & 0x3FFF) == 0) debug(20, 1, " %7d Lines read so far.\n", RB->linecount); @@ -1535,7 +1535,7 @@ storeCleanup(void *data) if ((validnum % 4096) == 0) debug(20, 1, " %7d Entries Validated so far.\n", validnum); if (!BIT_TEST(e->flag, ENTRY_VALIDATED)) - storeValidate(e, storeCleanupComplete, e); + storeValidate(e, storeCleanupComplete, e); xfree(curr->key); xfree(curr); eventAdd("storeCleanup", storeCleanup, NULL, 0); @@ -2563,20 +2563,20 @@ storeWriteCleanLogs(void) } debug(20, 1, "storeWriteCleanLogs: Starting...\n"); start = getCurrentTime(); - for (dirn = 0; dirn< ncache_dirs; dirn++) { - fd[dirn] = -1; - cur[dirn] = xstrdup(storeDirSwapLogFile(dirn, NULL)); - new[dirn] = xstrdup(storeDirSwapLogFile(dirn, ".clean")); - cln[dirn] = xstrdup(storeDirSwapLogFile(dirn, ".last-clean")); - safeunlink(new[dirn], 1); - safeunlink(cln[dirn], 1); - fd[dirn] = open(new[dirn], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, 0644); - if (fd[dirn] < 0) { + for (dirn = 0; dirn < ncache_dirs; dirn++) { + fd[dirn] = -1; + cur[dirn] = xstrdup(storeDirSwapLogFile(dirn, NULL)); + new[dirn] = xstrdup(storeDirSwapLogFile(dirn, ".clean")); + cln[dirn] = xstrdup(storeDirSwapLogFile(dirn, ".last-clean")); + safeunlink(new[dirn], 1); + safeunlink(cln[dirn], 1); + fd[dirn] = open(new[dirn], O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, 0644); + if (fd[dirn] < 0) { debug(50, 0, "storeWriteCleanLogs: %s: %s\n", new[dirn], xstrerror()); continue; } #if HAVE_FCHMOD - if (stat(cur[dirn], &sb) == 0) + if (stat(cur[dirn], &sb) == 0) fchmod(fd[dirn], sb.st_mode); #endif } @@ -2619,13 +2619,13 @@ storeWriteCleanLogs(void) } } safe_free(line); - for (dirn=0; dirn 0 ? r : 0, (double) n / (r > 0 ? r : 1)); /* touch a timestamp file if we're not still validating */ - for (dirn=0; dirnpath = xstrdup(path); tmp->max_size = size; tmp->l1 = l1; @@ -84,7 +84,7 @@ storeVerifyOrCreateDir(const char *path) { struct stat sb; if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { - debug(20,3,"%s exists\n", path); + debug(20, 3, "%s exists\n", path); return 0; } safeunlink(path, 1); @@ -365,14 +365,14 @@ storeDirUpdateSwapSize(int fn, size_t size, int sign) } void -storeDirStats(StoreEntry *sentry) +storeDirStats(StoreEntry * sentry) { int i; SwapDir *SD; storeAppendPrintf(sentry, "Store Directory Statistics:\n"); storeAppendPrintf(sentry, "Store Entries: %d\n", meta_data.store_entries); storeAppendPrintf(sentry, "Store Swap Size: %d KB\n", store_swap_size); - for (i = 0; ipath); @@ -381,6 +381,6 @@ storeDirStats(StoreEntry *sentry) storeAppendPrintf(sentry, "Maximum Size: %d KB\n", SD->max_size); storeAppendPrintf(sentry, "Current Size: %d KB\n", SD->cur_size); storeAppendPrintf(sentry, "Percent Used: %0.2f%%\n", - 100.0 * SD->cur_size / SD->max_size); + 100.0 * SD->cur_size / SD->max_size); } }