move initialize_config_defaults to conf.c
This commit is contained in:
parent
cd005a94ce
commit
25205fd1f3
22
src/conf.c
22
src/conf.c
@ -442,6 +442,28 @@ done:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initialize_config_defaults (struct config_s *conf)
|
||||||
|
{
|
||||||
|
memset (conf, 0, sizeof(*conf));
|
||||||
|
|
||||||
|
conf->config_file = safestrdup (SYSCONFDIR "/tinyproxy.conf");
|
||||||
|
if (!conf->config_file) {
|
||||||
|
fprintf (stderr, PACKAGE ": Could not allocate memory.\n");
|
||||||
|
exit (EX_SOFTWARE);
|
||||||
|
}
|
||||||
|
conf->godaemon = TRUE;
|
||||||
|
/*
|
||||||
|
* Make sure the HTML error pages array is NULL to begin with.
|
||||||
|
* (FIXME: Should have a better API for all this)
|
||||||
|
*/
|
||||||
|
conf->errorpages = NULL;
|
||||||
|
conf->stathost = safestrdup (TINYPROXY_STATHOST);
|
||||||
|
conf->idletimeout = MAX_IDLE_TIME;
|
||||||
|
conf->logf_name = NULL;
|
||||||
|
conf->pidpath = NULL;
|
||||||
|
conf->maxclients = 100;
|
||||||
|
}
|
||||||
|
|
||||||
static void initialize_with_defaults (struct config_s *conf,
|
static void initialize_with_defaults (struct config_s *conf,
|
||||||
struct config_s *defaults)
|
struct config_s *defaults)
|
||||||
{
|
{
|
||||||
|
@ -114,6 +114,8 @@ struct config_s {
|
|||||||
vector_t add_headers;
|
vector_t add_headers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void initialize_config_defaults (struct config_s *conf);
|
||||||
|
|
||||||
extern int reload_config_file (const char *config_fname, struct config_s *conf,
|
extern int reload_config_file (const char *config_fname, struct config_s *conf,
|
||||||
struct config_s *defaults);
|
struct config_s *defaults);
|
||||||
|
|
||||||
|
22
src/main.c
22
src/main.c
@ -284,28 +284,6 @@ change_user (const char *program)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void initialize_config_defaults (struct config_s *conf)
|
|
||||||
{
|
|
||||||
memset (conf, 0, sizeof(*conf));
|
|
||||||
|
|
||||||
conf->config_file = safestrdup (SYSCONFDIR "/tinyproxy.conf");
|
|
||||||
if (!conf->config_file) {
|
|
||||||
fprintf (stderr, PACKAGE ": Could not allocate memory.\n");
|
|
||||||
exit (EX_SOFTWARE);
|
|
||||||
}
|
|
||||||
conf->godaemon = TRUE;
|
|
||||||
/*
|
|
||||||
* Make sure the HTML error pages array is NULL to begin with.
|
|
||||||
* (FIXME: Should have a better API for all this)
|
|
||||||
*/
|
|
||||||
conf->errorpages = NULL;
|
|
||||||
conf->stathost = safestrdup (TINYPROXY_STATHOST);
|
|
||||||
conf->idletimeout = MAX_IDLE_TIME;
|
|
||||||
conf->logf_name = NULL;
|
|
||||||
conf->pidpath = NULL;
|
|
||||||
conf->maxclients = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convenience wrapper around reload_config_file
|
* convenience wrapper around reload_config_file
|
||||||
* that also re-initializes logging.
|
* that also re-initializes logging.
|
||||||
|
Loading…
Reference in New Issue
Block a user