summaryrefslogtreecommitdiffhomepage
path: root/src/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c104
1 files changed, 3 insertions, 101 deletions
diff --git a/src/conf.c b/src/conf.c
index c9a499e..69a4c85 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -441,7 +441,7 @@ done:
return ret;
}
-void initialize_config_defaults (struct config_s *conf)
+static void initialize_config_defaults (struct config_s *conf)
{
memset (conf, 0, sizeof(*conf));
@@ -457,108 +457,10 @@ void initialize_config_defaults (struct config_s *conf)
conf->maxclients = 100;
}
-static void initialize_with_defaults (struct config_s *conf,
- struct config_s *defaults)
-{
- if (defaults->logf_name) {
- conf->logf_name = safestrdup (defaults->logf_name);
- }
-
- conf->syslog = defaults->syslog;
- conf->port = defaults->port;
-
- if (defaults->stathost) {
- conf->stathost = safestrdup (defaults->stathost);
- }
-
- conf->quit = defaults->quit;
-
- if (defaults->user) {
- conf->user = safestrdup (defaults->user);
- }
-
- if (defaults->group) {
- conf->group = safestrdup (defaults->group);
- }
-
- if (defaults->listen_addrs) {
- ssize_t i;
-
- conf->listen_addrs = vector_create();
- for (i=0; i < vector_length(defaults->listen_addrs); i++) {
- char *addr;
- size_t size;
- addr = (char *)vector_getentry(defaults->listen_addrs,
- i, &size);
- vector_append(conf->listen_addrs, addr, size);
- }
-
- }
-
-#ifdef FILTER_ENABLE
- if (defaults->filter) {
- conf->filter = safestrdup (defaults->filter);
- }
-
- conf->filter_url = defaults->filter_url;
- conf->filter_extended = defaults->filter_extended;
- conf->filter_casesensitive = defaults->filter_casesensitive;
-#endif /* FILTER_ENABLE */
-
-#ifdef XTINYPROXY_ENABLE
- conf->add_xtinyproxy = defaults->add_xtinyproxy;
-#endif
-
-#ifdef REVERSE_SUPPORT
- /* struct reversepath *reversepath_list; */
- conf->reverseonly = defaults->reverseonly;
- conf->reversemagic = defaults->reversemagic;
-
- if (defaults->reversebaseurl) {
- conf->reversebaseurl = safestrdup (defaults->reversebaseurl);
- }
-#endif
-
-#ifdef UPSTREAM_SUPPORT
- /* struct upstream *upstream_list; */
-#endif /* UPSTREAM_SUPPORT */
-
- if (defaults->pidpath) {
- conf->pidpath = safestrdup (defaults->pidpath);
- }
-
- conf->idletimeout = defaults->idletimeout;
-
- if (defaults->bind_address) {
- conf->bind_address = safestrdup (defaults->bind_address);
- }
-
- conf->bindsame = defaults->bindsame;
-
- if (defaults->via_proxy_name) {
- conf->via_proxy_name = safestrdup (defaults->via_proxy_name);
- }
-
- conf->disable_viaheader = defaults->disable_viaheader;
-
- if (defaults->errorpage_undef) {
- conf->errorpage_undef = safestrdup (defaults->errorpage_undef);
- }
-
- if (defaults->statpage) {
- conf->statpage = safestrdup (defaults->statpage);
- }
-
- /* vector_t access_list; */
- /* vector_t connect_ports; */
- /* hashmap_t anonymous_map; */
-}
-
/**
* Load the configuration.
*/
-int reload_config_file (const char *config_fname, struct config_s *conf,
- struct config_s *defaults)
+int reload_config_file (const char *config_fname, struct config_s *conf)
{
int ret;
@@ -566,7 +468,7 @@ int reload_config_file (const char *config_fname, struct config_s *conf,
free_config (conf);
- initialize_with_defaults (conf, defaults);
+ initialize_config_defaults (conf);
ret = load_config_file (config_fname, conf);
if (ret != 0) {