From: wessels <> Date: Wed, 17 Apr 1996 05:05:43 +0000 (+0000) Subject: fix config_file (now ConfigFile) mem problems X-Git-Tag: SQUID_3_0_PRE1~6135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00fac1f8a1d7d215ec25169250bfbed7cad7f5f0;p=thirdparty%2Fsquid.git fix config_file (now ConfigFile) mem problems --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 2b089908f7..b03b76eab9 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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", diff --git a/src/main.cc b/src/main.cc index c23817fc2a..e50c2d1cd1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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); diff --git a/src/stat.cc b/src/stat.cc index 7fa90f223d..fda0fe60ca 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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);