]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- don't storeAddSwapDisk() again on reconfigure, instead call
authorwessels <>
Fri, 16 May 1997 13:43:46 +0000 (13:43 +0000)
committerwessels <>
Fri, 16 May 1997 13:43:46 +0000 (13:43 +0000)
  [new] storeReconfigureSwapDisk()

src/cache_cf.cc
src/store_dir.cc

index 709035d296e46da04b3c5ceae0becb637f156a61..a751ce479744e45979b365a6eeeba2b83616ae5b 100644 (file)
@@ -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
index 3598eb95934efee2f905d71ba4cfa77ef0b0a832..ffeaff2aa5f4ce0d7b6d3a7e791462063905bb6d 100644 (file)
@@ -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)
 {