]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fix config_file (now ConfigFile) mem problems
authorwessels <>
Wed, 17 Apr 1996 05:05:43 +0000 (05:05 +0000)
committerwessels <>
Wed, 17 Apr 1996 05:05:43 +0000 (05:05 +0000)
src/cache_cf.cc
src/main.cc
src/stat.cc

index 2b089908f70e81c67eda2a63dd4807d0b27cd6c4..b03b76eab956f1fe478ec81e1cbe58c4ef42a729 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cache_cf.cc,v 1.50 1996/04/16 22:52:04 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.51 1996/04/16 23:05:44 wessels Exp $ */
 
 /* DEBUG: Section 3             cache_cf: Configuration file parsing */
 
@@ -162,10 +162,6 @@ intlist https =
 intlist *connect_port_list = &https;
 
 
-
-ip_acl *proxy_ip_acl = NULL;
-ip_acl *accel_ip_acl = NULL;
-ip_acl *manager_ip_acl = NULL;
 ip_acl *local_ip_list = NULL;
 
 int zap_disk_store = 0;                /* off, try to rebuild from disk */
@@ -175,7 +171,8 @@ time_t neighbor_timeout = DefaultNeighborTimeout;   /* for fast access */
 int single_parent_bypass = 0;
 int DnsPositiveTtl = DefaultPositiveDnsTtl;
 char *DefaultSwapDir = DEFAULT_SWAP_DIR;
-char *config_file = xstrdup(DEFAULT_CONFIG_FILE);
+char *DefaultConfigFile = DEFAULT_CONFIG_FILE;
+char *ConfigFile = NULL                /* the whole thing */
 char *cfg_filename = NULL;     /* just the last part */
 
 char w_space[] = " \t\n";
@@ -1359,8 +1356,6 @@ int parseConfigFile(file_name)
        printf("         For this run, however, %s will use %d minutes for clean_rate.\n", appname, (int) (getCleanRate() / 60));
        fflush(stdout);         /* print message */
     }
-    if (accel_ip_acl == NULL)
-       accel_ip_acl = proxy_ip_acl;
 
     if (getDnsChildren() < 1) {
        printf("WARNING: dns_children was set to a bad value: %d\n",
index c23817fc2a442f3638bc33ae3fbe5fbc75114d1e..e50c2d1cd18acfefeee05d74499e57ed045c3036 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.cc,v 1.39 1996/04/16 20:31:22 wessels Exp $ */
+/* $Id: main.cc,v 1.40 1996/04/16 23:05:44 wessels Exp $ */
 
 /* DEBUG: Section 1             main: startup and main loop */
 
@@ -81,8 +81,8 @@ static void mainParseOptions(argc, argv)
            opt_unlink_on_reload = 1;
            break;
        case 'f':
-           xfree(config_file);
-           config_file = xstrdup(optarg);
+           xfree(ConfigFile);
+           ConfigFile = xstrdup(optarg);
            break;
        case 'a':
            asciiPortNumOverride = atoi(optarg);
@@ -174,7 +174,7 @@ static void mainReinitialize()
     /* Already called serverConnectionsClose and ipcacheShutdownServers() */
     neighborsDestroy();
 
-    parseConfigFile(config_file);
+    parseConfigFile(ConfigFile);
     _db_init(getCacheLogFile());
     neighbors_init();
     ipcacheOpenServers();
@@ -195,7 +195,9 @@ static void mainInitialize()
     signal(SIGPIPE, SIG_IGN);
     signal(SIGCHLD, sig_child);
 
-    parseConfigFile(config_file);
+    if (ConfigFile == NULL)
+       ConfigFile = xstrdup(DefaultConfigFile);
+    parseConfigFile(ConfigFile);
 
     if (asciiPortNumOverride > 0)
        setAsciiPortNum(asciiPortNumOverride);
index 7fa90f223d61f997b5eb00ffa9b2ca42995ca136..fda0fe60ca70429ea214f96efb0cf2f4e3476cd1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stat.cc,v 1.27 1996/04/16 16:35:31 wessels Exp $ */
+/* $Id: stat.cc,v 1.28 1996/04/16 23:05:43 wessels Exp $ */
 
 /*
  * DEBUG: Section 18          stat
@@ -312,12 +312,11 @@ void squid_get_start(obj, sentry)
      StoreEntry *sentry;
 {
     squid_read_data_t *data;
-    extern char *config_file;
 
     data = (squid_read_data_t *) xmalloc(sizeof(squid_read_data_t));
     memset(data, '\0', sizeof(squid_read_data_t));
     data->sentry = sentry;
-    data->fd = file_open((char *) config_file, NULL, O_RDONLY);
+    data->fd = file_open((char *) ConfigFile, NULL, O_RDONLY);
     storeAppend(sentry, open_bracket, (int) strlen(open_bracket));
     file_walk(data->fd, (FILE_WALK_HD) squidReadEndHandler, (void *) data,
        (FILE_WALK_LHD) squidReadHandler, (void *) data);