conf.c: merely warn on encountering recently obsoleted config items
if we don't handle these gracefully, pretty much every existing config file will fail with an error, which is probably not very friendly. the obsoleted config items can be made hard errors after the next release.
This commit is contained in:
parent
1186c297b4
commit
b09d8d927d
12
src/conf.c
12
src/conf.c
@ -140,6 +140,7 @@ static HANDLE_FUNC (handle_listen);
|
||||
static HANDLE_FUNC (handle_logfile);
|
||||
static HANDLE_FUNC (handle_loglevel);
|
||||
static HANDLE_FUNC (handle_maxclients);
|
||||
static HANDLE_FUNC (handle_obsolete);
|
||||
static HANDLE_FUNC (handle_pidfile);
|
||||
static HANDLE_FUNC (handle_port);
|
||||
#ifdef REVERSE_SUPPORT
|
||||
@ -213,6 +214,10 @@ struct {
|
||||
/* integer arguments */
|
||||
STDCONF ("port", INT, handle_port),
|
||||
STDCONF ("maxclients", INT, handle_maxclients),
|
||||
STDCONF ("maxspareservers", INT, handle_obsolete),
|
||||
STDCONF ("minspareservers", INT, handle_obsolete),
|
||||
STDCONF ("startservers", INT, handle_obsolete),
|
||||
STDCONF ("maxrequestsperchild", INT, handle_obsolete),
|
||||
STDCONF ("timeout", INT, handle_timeout),
|
||||
STDCONF ("connectport", INT, handle_connectport),
|
||||
/* alphanumeric arguments */
|
||||
@ -802,6 +807,13 @@ static HANDLE_FUNC (handle_maxclients)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HANDLE_FUNC (handle_obsolete)
|
||||
{
|
||||
fprintf (stderr, "WARNING: obsolete config item on line %lu\n",
|
||||
lineno);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HANDLE_FUNC (handle_timeout)
|
||||
{
|
||||
return set_int_arg (&conf->idletimeout, line, &match[2]);
|
||||
|
Loading…
Reference in New Issue
Block a user