diff options
author | Omar Polo <op@omarpolo.com> | 2022-09-10 09:43:57 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2022-09-10 09:43:57 +0000 |
commit | cd5826b8ba3b43ed9802309688ae029c0f5c4081 (patch) | |
tree | 6de2abea6c0b82ca7084526815a8715263809254 | |
parent | aa9543b9fd1963d86f63fda13addb356f9039c37 (diff) |
retire the deprecated `mime' and `map' config options
-rw-r--r-- | gmid.c | 2 | ||||
-rw-r--r-- | gmid.h | 7 | ||||
-rw-r--r-- | mime.c | 4 | ||||
-rw-r--r-- | parse.y | 26 |
4 files changed, 6 insertions, 33 deletions
@@ -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(); @@ -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 { @@ -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; @@ -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}, |