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:
rofl0r 2018-12-18 23:38:00 +00:00
parent b6ab13aa27
commit 6bc09bc876

View File

@ -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]);