summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2018-05-18 14:24:27 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2018-05-18 14:24:27 +0000
commitf1ee3653ef7e9f5eb39abc47599b7ccae1fd9031 (patch)
tree807a3bbaa0f7844192c1e8fa794efcf42dd898e4 /usr.sbin/httpd
parentd78ffe229869321c11d95290e163b213f8de7b25 (diff)
Revert previous: it introduced a shift/reduce conflict in the grammar.
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/httpd.conf.54
-rw-r--r--usr.sbin/httpd/parse.y21
2 files changed, 7 insertions, 18 deletions
diff --git a/usr.sbin/httpd/httpd.conf.5 b/usr.sbin/httpd/httpd.conf.5
index 104dbf89f97..b86a4a11566 100644
--- a/usr.sbin/httpd/httpd.conf.5
+++ b/usr.sbin/httpd/httpd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: httpd.conf.5,v 1.91 2018/05/18 14:07:46 reyk Exp $
+.\" $OpenBSD: httpd.conf.5,v 1.92 2018/05/18 14:24:26 reyk Exp $
.\"
.\" Copyright (c) 2014, 2015 Reyk Floeter <reyk@openbsd.org>
.\"
@@ -99,7 +99,7 @@ For example:
.Bd -literal -offset indent
ext_ip="10.0.0.1"
server "default" {
- listen on $ext_ip
+ listen on $ext_ip port 80
}
.Ed
.Sh GLOBAL CONFIGURATION
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index 7220921398b..538bb4b4198 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.95 2018/05/18 14:07:46 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.96 2018/05/18 14:24:26 reyk Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -136,7 +136,7 @@ typedef struct {
%token ERROR INCLUDE AUTHENTICATE WITH BLOCK DROP RETURN PASS
%token <v.string> STRING
%token <v.number> NUMBER
-%type <v.port> optport
+%type <v.port> port
%type <v.number> opttls optmatch
%type <v.tv> timeout
%type <v.string> numberstring optstring
@@ -405,7 +405,7 @@ serveropts_l : serveropts_l serveroptsl nl
| serveroptsl optnl
;
-serveroptsl : LISTEN ON STRING opttls optport {
+serveroptsl : LISTEN ON STRING opttls port {
struct addresslist al;
struct address *h;
struct server_config *s_conf, *alias = NULL;
@@ -452,15 +452,9 @@ serveroptsl : LISTEN ON STRING opttls optport {
s_conf = &srv->srv_conf;
memcpy(&s_conf->ss, &h->ss, sizeof(s_conf->ss));
+ s_conf->port = h->port.val[0];
s_conf->prefixlen = h->prefixlen;
- /* Set the default port to 80 or 443 */
- if (!h->port.op)
- s_conf->port = htons($4 ?
- HTTPS_PORT : HTTP_PORT);
- else
- s_conf->port = h->port.val[0];
-
if ($4)
s_conf->flags |= SRVFLAG_TLS;
@@ -1146,16 +1140,12 @@ medianamesl : numberstring {
}
;
-optport : /* empty */ {
- $$.op = 0;
- }
- | PORT NUMBER {
+port : PORT NUMBER {
if ($2 <= 0 || $2 > (int)USHRT_MAX) {
yyerror("invalid port: %lld", $2);
YYERROR;
}
$$.val[0] = htons($2);
- $$.op = 1;
}
| PORT STRING {
int val;
@@ -1168,7 +1158,6 @@ optport : /* empty */ {
free($2);
$$.val[0] = val;
- $$.op = 1;
}
;