Fixed up whitespace formatting of the config file directives. Also

added blank lines to group related directives.
This commit is contained in:
Robert James Kaes 2005-11-04 00:47:07 +00:00
parent bed712ffa7
commit ffec04c65e

View File

@ -1,4 +1,4 @@
/* $Id: conffile.c,v 1.6 2005-08-16 04:03:19 rjkaes Exp $ /* $Id: conffile.c,v 1.7 2005-11-04 00:47:07 rjkaes Exp $
* *
* Parses the configuration file and sets up the config_s structure for * Parses the configuration file and sets up the config_s structure for
* use by the application. This file replaces the old grammar.y and * use by the application. This file replaces the old grammar.y and
@ -150,59 +150,68 @@ struct {
regex_t *cre; regex_t *cre;
} directives[] = { } directives[] = {
/* comments */ /* comments */
{ { BEGIN "#", handle_nop},
BEGIN "#", handle_nop},
/* blank lines */ /* blank lines */
{ { "^[[:space:]]+$", handle_nop },
"^[[:space:]]+$", handle_nop},
/* string arguments */ /* string arguments */
STDCONF("logfile", STR, handle_logfile), STDCONF("logfile", STR, handle_logfile),
STDCONF("pidfile", STR, handle_pidfile), STDCONF("pidfile", STR, handle_pidfile),
STDCONF("anonymous", STR, handle_anonymous), STDCONF("anonymous", STR, handle_anonymous),
STDCONF("viaproxyname", STR, handle_viaproxyname), STDCONF("viaproxyname", STR, handle_viaproxyname),
STDCONF("defaulterrorfile", STR, handle_defaulterrorfile), STDCONF("defaulterrorfile", STR, handle_defaulterrorfile),
STDCONF("statfile", STR, handle_statfile), STDCONF("statfile", STR, handle_statfile),
STDCONF("stathost", STR, handle_stathost), STDCONF("stathost", STR, handle_stathost),
STDCONF("xtinyproxy", STR, handle_xtinyproxy), STDCONF("xtinyproxy", STR, handle_xtinyproxy),
/* boolean arguments */
STDCONF("syslog", BOOL, handle_syslog), /* boolean arguments */
STDCONF("bindsame", BOOL, handle_bindsame), STDCONF("syslog", BOOL, handle_syslog),
/* integer arguments */ STDCONF("bindsame", BOOL, handle_bindsame),
STDCONF("port", INT, handle_port),
STDCONF("maxclients", INT, handle_maxclients), /* integer arguments */
STDCONF("maxspareservers", INT, handle_maxspareservers), STDCONF("port", INT, handle_port),
STDCONF("minspareservers", INT, handle_minspareservers), STDCONF("maxclients", INT, handle_maxclients),
STDCONF("startservers", INT, handle_startservers), STDCONF("maxspareservers", INT, handle_maxspareservers),
STDCONF("maxrequestsperchild", INT, handle_maxrequestsperchild), STDCONF("minspareservers", INT, handle_minspareservers),
STDCONF("timeout", INT, handle_timeout), STDCONF("startservers", INT, handle_startservers),
STDCONF("connectport", INT, handle_connectport), STDCONF("maxrequestsperchild", INT, handle_maxrequestsperchild),
/* alphanumeric arguments */ STDCONF("timeout", INT, handle_timeout),
STDCONF("user", ALNUM, handle_user), STDCONF("connectport", INT, handle_connectport),
STDCONF("group", ALNUM, handle_group),
/* ip arguments */ /* alphanumeric arguments */
STDCONF("listen", IP, handle_listen), STDCONF("user", ALNUM, handle_user),
STDCONF("allow", "(" IPMASK "|" ALNUM ")", handle_allow), STDCONF("group", ALNUM, handle_group),
STDCONF("deny", "(" IPMASK "|" ALNUM ")", handle_deny),
STDCONF("bind", IP, handle_bind), /* ip arguments */
/* error files */ STDCONF("listen", IP, handle_listen),
STDCONF("errorfile", INT WS STR, handle_errorfile), STDCONF("allow", "(" IPMASK "|" ALNUM ")", handle_allow),
/* filtering */ STDCONF("deny", "(" IPMASK "|" ALNUM ")", handle_deny),
STDCONF("filter", STR, handle_filter), STDCONF("bind", IP, handle_bind),
STDCONF("filterurls", BOOL, handle_filterurls),
STDCONF("filterextended", BOOL, handle_filterextended), /* error files */
STDCONF("filterdefaultdeny", BOOL, handle_filterdefaultdeny), STDCONF("errorfile", INT WS STR, handle_errorfile),
STDCONF("filtercasesensitive", BOOL, handle_filtercasesensitive),
/* Reverse proxy arguments */ /* filtering */
STDCONF("reversebaseurl", STR, handle_reversebaseurl), STDCONF("filter", STR, handle_filter),
STDCONF("reverseonly", BOOL, handle_reverseonly), STDCONF("filterurls", BOOL, handle_filterurls),
STDCONF("reversemagic", BOOL, handle_reversemagic), STDCONF("filterextended", BOOL, handle_filterextended),
STDCONF("reversepath", STR WS "(" STR ")?", handle_reversepath), STDCONF("filterdefaultdeny", BOOL, handle_filterdefaultdeny),
/* upstream is rather complicated */ STDCONF("filtercasesensitive", BOOL, handle_filtercasesensitive),
/* Reverse proxy arguments */
STDCONF("reversebaseurl", STR, handle_reversebaseurl),
STDCONF("reverseonly", BOOL, handle_reverseonly),
STDCONF("reversemagic", BOOL, handle_reversemagic),
STDCONF("reversepath", STR WS "(" STR ")?", handle_reversepath),
/* upstream is rather complicated */
// { BEGIN "no" WS "upstream" WS STR END, handle_no_upstream }, // { BEGIN "no" WS "upstream" WS STR END, handle_no_upstream },
// { BEGIN "upstream" WS IP ":" INT "(" WS STR ")" END, handle_upstream }, // { BEGIN "upstream" WS IP ":" INT "(" WS STR ")" END, handle_upstream },
/* loglevel */
STDCONF("loglevel", "(critical|error|warning|notice|connect|info)", /* loglevel */
handle_loglevel) STDCONF("loglevel", "(critical|error|warning|notice|connect|info)",
handle_loglevel)
}; };
const unsigned int ndirectives = sizeof(directives) / sizeof(directives[0]); const unsigned int ndirectives = sizeof(directives) / sizeof(directives[0]);