Change grammar from "log [style]" to "log style [style]".
authorreyk <reyk@openbsd.org>
Mon, 4 Aug 2014 16:07:59 +0000 (16:07 +0000)
committerreyk <reyk@openbsd.org>
Mon, 4 Aug 2014 16:07:59 +0000 (16:07 +0000)
etc/examples/httpd.conf
usr.sbin/httpd/parse.y

index 43edfaa..161c4d8 100644 (file)
@@ -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" {
index 641f20a..7c42e47 100644 (file)
@@ -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 <reyk@openbsd.org>
@@ -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 <v.string>      STRING
 %token  <v.number>     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 }
        };