Commit Diff
Diff:
8ff40039e885f6ba64c887f390daf7e7f3bc2ff8
0d047efcb40ec311da407e0b705a92f764c96338
Commit:
0d047efcb40ec311da407e0b705a92f764c96338
Tree:
1ec310ab800da0f092c891ddc4b48de2c3e61a7a
Author:
Omar Polo <op@omarpolo.com>
Date:
Mon May 24 09:09:10 2021 UTC
Message:
refactor fastcgi block
commit - 8ff40039e885f6ba64c887f390daf7e7f3bc2ff8
commit + 0d047efcb40ec311da407e0b705a92f764c96338
blob - e3eff65b82b6d0c29ddad82ec37d1e9540549bd4
blob + fe4b6c4c7123a049f5eb14a268a5cb3a37731974
--- parse.y
+++ parse.y
@@ -206,29 +206,7 @@ locopt : TAUTO TINDEX TBOOL { loc->auto_index = $3 ?
only_once(loc->default_mime, "default type");
loc->default_mime = $3;
}
- | TFASTCGI TSPAWN TSTRING {
- only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf(NULL, NULL, $3);
- }
- | TFASTCGI TSTRING {
- only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf($2, NULL, NULL);
- }
- | TFASTCGI TTCP TSTRING TNUM {
- char *c;
- if (asprintf(&c, "%d", $4) == -1)
- err(1, "asprintf");
- only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf($3, c, NULL);
- }
- | TFASTCGI TTCP TSTRING {
- only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf($3, xstrdup("9000"), NULL);
- }
- | TFASTCGI TTCP TSTRING TSTRING {
- only_oncei(loc->fcgi, "fastcgi");
- loc->fcgi = fastcgi_conf($3, $4, NULL);
- }
+ | TFASTCGI fastcgi
| TINDEX TSTRING {
only_once(loc->index, "index");
loc->index = $2;
@@ -252,6 +230,31 @@ locopt : TAUTO TINDEX TBOOL { loc->auto_index = $3 ?
| TSTRIP TNUM { loc->strip = check_strip_no($2); }
;
+fastcgi : TSPAWN TSTRING {
+ only_oncei(loc->fcgi, "fastcgi");
+ loc->fcgi = fastcgi_conf(NULL, NULL, $2);
+ }
+ | TSTRING {
+ only_oncei(loc->fcgi, "fastcgi");
+ loc->fcgi = fastcgi_conf($1, NULL, NULL);
+ }
+ | TTCP TSTRING TNUM {
+ char *c;
+ if (asprintf(&c, "%d", $3) == -1)
+ err(1, "asprintf");
+ only_oncei(loc->fcgi, "fastcgi");
+ loc->fcgi = fastcgi_conf($2, c, NULL);
+ }
+ | TTCP TSTRING {
+ only_oncei(loc->fcgi, "fastcgi");
+ loc->fcgi = fastcgi_conf($2, xstrdup("9000"), NULL);
+ }
+ | TTCP TSTRING TSTRING {
+ only_oncei(loc->fcgi, "fastcgi");
+ loc->fcgi = fastcgi_conf($2, $3, NULL);
+ }
+ ;
+
%%
static struct vhost *
Omar Polo