From: wessels <> Date: Fri, 16 May 1997 13:43:46 +0000 (+0000) Subject: - don't storeAddSwapDisk() again on reconfigure, instead call X-Git-Tag: SQUID_3_0_PRE1~4994 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd8a8a892101f0ecd86e523f911289e3aba6fbe;p=thirdparty%2Fsquid.git - don't storeAddSwapDisk() again on reconfigure, instead call [new] storeReconfigureSwapDisk() --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 709035d296..a751ce4797 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.189 1997/05/15 23:30:58 wessels Exp $ + * $Id: cache_cf.cc,v 1.190 1997/05/16 07:43:54 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -877,7 +877,10 @@ parseCacheDir(void) if ((token = strtok(NULL, w_space))) if (!strcasecmp(token, "read-only")) readonly = 1; - storeAddSwapDisk(dir, size, l1, l2, readonly); + if (configured_once) + storeReconfigureSwapDisk(dir, size, l1, l2, readonly); + else + storeAddSwapDisk(dir, size, l1, l2, readonly); } int diff --git a/src/store_dir.cc b/src/store_dir.cc index 3598eb9593..ffeaff2aa5 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -69,6 +69,7 @@ storeAddSwapDisk(const char *path, int size, int l1, int l2, int read_only) xfree(SwapDirs); SwapDirs = tmp; } + debug(20,1,"Creating Swap Dir #%d in %s\n", ncache_dirs+1, path); tmp = SwapDirs + ncache_dirs; tmp->path = xstrdup(path); tmp->max_size = size; @@ -80,6 +81,21 @@ storeAddSwapDisk(const char *path, int size, int l1, int l2, int read_only) return ++ncache_dirs; } +void +storeReconfigureSwapDisk(const char *path, int size, int l1, int l2, int read_only) +{ + int i; + for (i = 0; i < ncache_dirs; i++) { + if (!strcmp(path, SwapDirs[i].path)) + break; + } + if (i == ncache_dirs) + return; + SwapDirs[i].max_size = size; + SwapDirs[i].read_only = read_only; + /* ignore the rest */ +} + static int storeVerifyOrCreateDir(const char *path) {