added --strict mode

This commit is contained in:
Unbit
2013-07-25 21:24:04 +02:00
parent 5c5aef3827
commit a0cb71ca78
3 changed files with 7 additions and 0 deletions
+4
View File
@@ -458,6 +458,10 @@ add:
uwsgi.exported_opts[id]->configured = 1;
}
}
else if (uwsgi.strict) {
uwsgi_log("[strict-mode] unknown config directive: %s\n", key);
exit(1);
}
}
+1
View File
@@ -72,6 +72,7 @@ static struct uwsgi_option uwsgi_base_options[] = {
{"xml", required_argument, 'x', "load config from xml file", uwsgi_opt_load_xml, NULL, UWSGI_OPT_IMMEDIATE},
#endif
{"config", required_argument, 0, "load configuration using the pluggable system", uwsgi_opt_load_config, NULL, UWSGI_OPT_IMMEDIATE},
{"strict", no_argument, 0, "enable strict mode (placeholder cannot be used)", uwsgi_opt_true, &uwsgi.strict, UWSGI_OPT_IMMEDIATE},
{"skip-zero", no_argument, 0, "skip check of file descriptor 0", uwsgi_opt_true, &uwsgi.skip_zero, 0},
{"skip-atexit", no_argument, 0, "skip atexit hooks (ignored by the master)", uwsgi_opt_true, &uwsgi.skip_atexit, 0},
+2
View File
@@ -1752,6 +1752,8 @@ struct uwsgi_server {
int dump_options;
// show ini representation of the current config
int show_config;
// enable strict mode (only registered options can be used)
int strict;
// list loaded features
int cheaper_algo_list;