Commit Diff
Diff:
ff954a3e7641e83cca043ecc30789132478c7acd
762b9b991f373e5077d7e49396af62a34fa1c1ff
Commit:
762b9b991f373e5077d7e49396af62a34fa1c1ff
Tree:
54df1927e78e706b1a92e44a28263fecf9a93281
Author:
Omar Polo <op@omarpolo.com>
Date:
Fri Jul 9 06:30:55 2021 UTC
Message:
add => in env/param and `port' between hostname and port for fastcgi

In the same spite of the last commit, add the missing separators
between strings to avoid the auto-concat pitfalls. `=>' is used to
separate between `env' and `param' arguments, while for `fastcgi' the
keyword `port' is required between the hostname/ip address and the
port (if provided).

Since `env', `param' and `fastcgi' are all new stuff, there's no need
to keep compatibility.
commit - ff954a3e7641e83cca043ecc30789132478c7acd
commit + 762b9b991f373e5077d7e49396af62a34fa1c1ff
blob - 11c017ea01d9e617708fea4f92e0cf5acc7feeb2
blob + baa756501b61b67c3c1188aa17bce09fcb31163e
--- gmid.1
+++ gmid.1
@@ -297,7 +297,7 @@ CGI script at
Handle all the requests for the current virtual host using the
CGI script at
.Pa path .
-.It Ic env Ar name Ar value
+.It Ic env Ar name Cm => Ar value
Set the environment variable
.Ar name
to
@@ -306,7 +306,7 @@ Can be provided more than once.
Can be provided more than once.
.\" don't document the "spawn <prog>" form because it probably won't
.\" be kept.
-.It Ic fastcgi Oo Ic tcp Oc Pa socket Oo Ar port Oc
+.It Ic fastcgi Oo Ic tcp Oc Pa socket Oo Cm port Ar port Oc
Enable FastCGI instead of serving files.
The
.Pa socket
@@ -359,7 +359,7 @@ Enable or disable the logging for the current server o
.Ic entrypoint No and Ic cgi .
.It Ic log Ar bool
Enable or disable the logging for the current server or location block.
-.It Ic param Ar name Ar value
+.It Ic param Ar name Cm => Ar value
Set the param
.Ar name
to
blob - 4ecee6323805408d152defbdfed74af8e2cdb12f
blob + 65637912ffad1050ef333fb046b6b338b9c1b1a7
--- parse.y
+++ parse.y
@@ -88,7 +88,7 @@ char *symget(const char *);
%token TIPV6 TPORT TPROTOCOLS TMIME TDEFAULT TTYPE TCHROOT TUSER TSERVER
%token TPREFORK TLOCATION TCERT TKEY TROOT TCGI TENV TLANG TLOG TINDEX TAUTO
%token TSTRIP TBLOCK TRETURN TENTRYPOINT TREQUIRE TCLIENT TCA TALIAS TTCP
-%token TFASTCGI TSPAWN TPARAM TMAP TTOEXT
+%token TFASTCGI TSPAWN TPARAM TMAP TTOEXT TARROW
%token TERR
@@ -210,15 +210,15 @@ servopt : TALIAS string {
memmove($2, $2+1, strlen($2));
host->entrypoint = $2;
}
- | TENV string string {
- add_param($2, $3, 1);
+ | TENV string TARROW string {
+ add_param($2, $4, 1);
}
| TKEY string {
only_once(host->key, "key");
host->key = ensure_absolute_path($2);
}
- | TPARAM string string {
- add_param($2, $3, 0);
+ | TPARAM string TARROW string {
+ add_param($2, $4, 0);
}
| locopt
;
@@ -294,9 +294,9 @@ fastcgi : TSPAWN string {
only_oncei(loc->fcgi, "fastcgi");
loc->fcgi = fastcgi_conf($1, NULL, NULL);
}
- | TTCP string TNUM {
+ | TTCP string TPORT TNUM {
char *c;
- if (asprintf(&c, "%d", $3) == -1)
+ if (asprintf(&c, "%d", $4) == -1)
err(1, "asprintf");
only_oncei(loc->fcgi, "fastcgi");
loc->fcgi = fastcgi_conf($2, c, NULL);
@@ -305,9 +305,9 @@ fastcgi : TSPAWN string {
only_oncei(loc->fcgi, "fastcgi");
loc->fcgi = fastcgi_conf($2, xstrdup("9000"), NULL);
}
- | TTCP string string {
+ | TTCP string TPORT string {
only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf($2, $3, NULL);
+ loc->fcgi = fastcgi_conf($2, $4, NULL);
}
;
@@ -429,7 +429,10 @@ repeat:
yylval.lineno++;
goto repeat;
case '=':
- return c;
+ if ((c = getc(yyfp)) == '>')
+ return TARROW;
+ ungetc(c, yyfp);
+ return '=';
case EOF:
goto eof;
}
Omar Polo