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 committed by rofl0r
parent 1186c297b4
commit b09d8d927d

View File

@ -140,6 +140,7 @@ static HANDLE_FUNC (handle_listen);
static HANDLE_FUNC (handle_logfile); static HANDLE_FUNC (handle_logfile);
static HANDLE_FUNC (handle_loglevel); static HANDLE_FUNC (handle_loglevel);
static HANDLE_FUNC (handle_maxclients); static HANDLE_FUNC (handle_maxclients);
static HANDLE_FUNC (handle_obsolete);
static HANDLE_FUNC (handle_pidfile); static HANDLE_FUNC (handle_pidfile);
static HANDLE_FUNC (handle_port); static HANDLE_FUNC (handle_port);
#ifdef REVERSE_SUPPORT #ifdef REVERSE_SUPPORT
@ -213,6 +214,10 @@ struct {
/* integer arguments */ /* integer arguments */
STDCONF ("port", INT, handle_port), STDCONF ("port", INT, handle_port),
STDCONF ("maxclients", INT, handle_maxclients), 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 ("timeout", INT, handle_timeout),
STDCONF ("connectport", INT, handle_connectport), STDCONF ("connectport", INT, handle_connectport),
/* alphanumeric arguments */ /* alphanumeric arguments */
@ -802,6 +807,13 @@ static HANDLE_FUNC (handle_maxclients)
return 0; 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) static HANDLE_FUNC (handle_timeout)
{ {
return set_int_arg (&conf->idletimeout, line, &match[2]); return set_int_arg (&conf->idletimeout, line, &match[2]);