From: reyk Date: Mon, 4 Aug 2014 16:07:59 +0000 (+0000) Subject: Change grammar from "log [style]" to "log style [style]". X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cef70b1445ff72129df2ba9fd3fefd864ebf6e5c;p=openbsd Change grammar from "log [style]" to "log style [style]". --- diff --git a/etc/examples/httpd.conf b/etc/examples/httpd.conf index 43edfaa3a74..161c4d80260 100644 --- a/etc/examples/httpd.conf +++ b/etc/examples/httpd.conf @@ -1,4 +1,4 @@ -# $OpenBSD: httpd.conf,v 1.6 2014/08/03 11:51:40 reyk Exp $ +# $OpenBSD: httpd.conf,v 1.7 2014/08/04 16:07:59 reyk Exp $ # # Macros @@ -28,7 +28,7 @@ server "www.example.com" { location "/pub/*" { directory auto index - log combined + log style combined } location "*.php" { diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y index 641f20a1d3f..7c42e47a421 100644 --- a/usr.sbin/httpd/parse.y +++ b/usr.sbin/httpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.21 2014/08/04 15:49:28 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.22 2014/08/04 16:07:59 reyk Exp $ */ /* * Copyright (c) 2007 - 2014 Reyk Floeter @@ -125,7 +125,7 @@ typedef struct { %} %token AUTO COMMON COMBINED CONNECTION DIRECTORY FCGI FILE INDEX LISTEN -%token LOCATION LOG NO ON PORT PREFORK ROOT SERVER SOCKET SYSLOG TYPES +%token LOCATION LOG NO ON PORT PREFORK ROOT SERVER SOCKET STYLE SYSLOG TYPES %token ERROR INCLUDE %token STRING %token NUMBER @@ -445,7 +445,19 @@ logflags_l : logflags comma logflags_l | logflags ; -logflags : COMMON { + +logflags : STYLE logstyle + | SYSLOG { + srv->srv_conf.flags &= ~SRVFLAG_NO_SYSLOG; + srv->srv_conf.flags |= SRVFLAG_SYSLOG; + } + | NO SYSLOG { + srv->srv_conf.flags &= ~SRVFLAG_SYSLOG; + srv->srv_conf.flags |= SRVFLAG_NO_SYSLOG; + } + ; + +logstyle : COMMON { srv->srv_conf.flags &= ~SRVFLAG_NO_LOG; srv->srv_conf.flags |= SRVFLAG_LOG; srv->srv_conf.logformat = LOG_FORMAT_COMMON; @@ -460,14 +472,6 @@ logflags : COMMON { srv->srv_conf.flags |= SRVFLAG_LOG; srv->srv_conf.logformat = LOG_FORMAT_CONNECTION; } - | SYSLOG { - srv->srv_conf.flags &= ~SRVFLAG_NO_SYSLOG; - srv->srv_conf.flags |= SRVFLAG_SYSLOG; - } - | NO SYSLOG { - srv->srv_conf.flags &= ~SRVFLAG_SYSLOG; - srv->srv_conf.flags |= SRVFLAG_NO_SYSLOG; - } ; types : TYPES '{' optnl mediaopts_l '}' @@ -616,6 +620,7 @@ lookup(char *s) { "root", ROOT }, { "server", SERVER }, { "socket", SOCKET }, + { "style", STYLE }, { "syslog", SYSLOG }, { "types", TYPES } };