]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
When reconfiguring, don't free the cacheSwap data structs, we can only
authorwessels <>
Sun, 23 Nov 1997 13:48:39 +0000 (13:48 +0000)
committerwessels <>
Sun, 23 Nov 1997 13:48:39 +0000 (13:48 +0000)
change the size and the read/write flag.

src/cache_cf.cc

index 67184a65f70a74293fee87186c4089fff34ce61a..dbad86fbcd077844756225eb65f30c16d4ef3c4b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.233 1997/11/13 02:32:37 wessels Exp $
+ * $Id: cache_cf.cc,v 1.234 1997/11/23 06:48:39 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -457,7 +457,16 @@ parse_cachedir(struct _cacheSwap *swap)
        tmp = swap->swapDirs + i;
        if (!strcmp(path, tmp->path)) {
            /* just reconfigure it */
+           if (size == tmp->max_size)
+               debug(3,1)("Cache dir '%s' size remains unchanged at %d MB\n",
+                       path, size);
+           else
+               debug(3,1)("Cache dir '%s' size changed to %d MB\n",
+                       path, size);
            tmp->max_size = size;
+           if (tmp->read_only != readonly)
+               debug(3,1)("Cache dir '%s' now %s\n",
+                       readonly ? "Read-Only" : "Read-Write");
            tmp->read_only = readonly;
            return;
        }
@@ -490,6 +499,9 @@ free_cachedir(struct _cacheSwap *swap)
 {
     SwapDir *s;
     int i;
+    /* DON'T FREE THESE FOR RECONFIGURE */
+    if (reconfigure_pending)
+       return;
     for (i = 0; i < swap->n_configured; i++) {
        s = swap->swapDirs + i;
        if (s->swaplog_fd > -1) {