aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-09-10 09:43:57 +0000
committerOmar Polo <op@omarpolo.com>2022-09-10 09:43:57 +0000
commitcd5826b8ba3b43ed9802309688ae029c0f5c4081 (patch)
tree6de2abea6c0b82ca7084526815a8715263809254
parentaa9543b9fd1963d86f63fda13addb356f9039c37 (diff)
retire the deprecated `mime' and `map' config options
-rw-r--r--gmid.c2
-rw-r--r--gmid.h7
-rw-r--r--mime.c4
-rw-r--r--parse.y26
4 files changed, 6 insertions, 33 deletions
diff --git a/gmid.c b/gmid.c
index 92ff26b..c1fc46e 100644
--- a/gmid.c
+++ b/gmid.c
@@ -186,7 +186,7 @@ static int
listener_main(struct imsgbuf *ibuf)
{
drop_priv();
- if (!conf.mime.skip_defaults && load_default_mime(&conf.mime) == -1)
+ if (load_default_mime(&conf.mime) == -1)
fatal("load_default_mime: %s", strerror(errno));
sort_mime(&conf.mime);
load_vhosts();
diff --git a/gmid.h b/gmid.h
index 3d25403..68026c0 100644
--- a/gmid.h
+++ b/gmid.h
@@ -186,13 +186,6 @@ struct mime {
struct etm *t;
size_t len;
size_t cap;
-
- /*
- * Backward compatibility: types override the built-in list,
- * but the deprecated `mime' and `map' don't. It's still too
- * early to remove `mime' and `map' from the config parser.
- */
- int skip_defaults;
};
struct conf {
diff --git a/mime.c b/mime.c
index ad338f0..1586cf8 100644
--- a/mime.c
+++ b/mime.c
@@ -82,6 +82,10 @@ load_default_mime(struct mime *mime)
{NULL, NULL}
}, *i;
+ /* don't load the default if `types' was used. */
+ if (mime->len != 0)
+ return 0;
+
for (i = m; i->mime != NULL; ++i) {
if (add_mime(mime, i->mime, i->ext) == -1)
return -1;
diff --git a/parse.y b/parse.y
index 6a664f9..c48c046 100644
--- a/parse.y
+++ b/parse.y
@@ -123,7 +123,6 @@ typedef struct {
%token INCLUDE INDEX IPV6
%token KEY
%token LANG LOCATION LOG
-%token MAP MIME
%token OCSP OFF ON
%token PARAM PORT PREFORK PROTO PROTOCOLS PROXY
%token RELAY_TO REQUIRE RETURN ROOT
@@ -219,24 +218,6 @@ option : CHROOT string {
free($2);
}
| IPV6 bool { conf.ipv6 = $2; }
- | MIME STRING string {
- yywarn("`mime MIME EXT' is deprecated and will be "
- "removed in a future version, please use the new "
- "`types' block.");
- if (add_mime(&conf.mime, $2, $3) == -1)
- err(1, "add_mime");
- free($2);
- free($3);
- }
- | MAP string TOEXT string {
- yywarn("`map mime to-ext' is deprecated and will be "
- "removed in a future version, please use the new "
- "`types' block.");
- if (add_mime(&conf.mime, $2, $4) == -1)
- err(1, "add_mime");
- free($2);
- free($4);
- }
| PORT NUM { conf.port = check_port_num($2); }
| PREFORK NUM { conf.prefork = check_prefork_num($2); }
| PROTOCOLS string {
@@ -472,10 +453,7 @@ fastcgi : SPAWN string {
}
;
-types : TYPES '{' optnl mediaopts_l '}' {
- conf.mime.skip_defaults = 1;
- }
- ;
+types : TYPES '{' optnl mediaopts_l '}' ;
mediaopts_l : mediaopts_l mediaoptsl nl
| mediaoptsl nl
@@ -535,8 +513,6 @@ static const struct keyword {
{"lang", LANG},
{"location", LOCATION},
{"log", LOG},
- {"map", MAP},
- {"mime", MIME},
{"ocsp", OCSP},
{"off", OFF},
{"on", ON},