diff --git a/plugins/python/wsgi_headers.c b/plugins/python/wsgi_headers.c index 216b8405..bb8a689e 100644 --- a/plugins/python/wsgi_headers.c +++ b/plugins/python/wsgi_headers.c @@ -38,7 +38,8 @@ PyObject *py_uwsgi_spit(PyObject * self, PyObject * args) { // in this way, error will be reported to the log PyErr_Restore(exc_type, exc_val, exc_tb); - goto clear; + // the error is reported, let's continue... + //goto clear; } } diff --git a/uwsgi.c b/uwsgi.c index 5aa322dc..15e0bf3e 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -49,6 +49,7 @@ static struct option long_base_options[] = { {"xmlconfig", required_argument, 0, 'x'}, {"xml", required_argument, 0, 'x'}, #endif + {"set", required_argument, 0, 'S'}, {"inherit", required_argument, 0, LONG_ARGS_INHERIT}, {"daemonize", required_argument, 0, 'd'}, {"listen", required_argument, 0, 'l'}, @@ -2821,6 +2822,16 @@ static int manage_base_opt(int i, char *optarg) { case LONG_ARGS_PROFILER: uwsgi.profiler = optarg; return 1; + case 'S': + p = strchr(optarg, '='); + if (!p) { + uwsgi_log("invalid --set value\n"); + exit(1); + } + p[0] = 0; + add_exported_option(uwsgi_str(optarg), p+1, 1); + p[0] = '='; + return 1; case LONG_ARGS_INHERIT: uct = uwsgi.config_templates; if (!uct) { diff --git a/uwsgi.h b/uwsgi.h index 3d9d60b2..ed87ed88 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -13,6 +13,7 @@ extern "C" { #define uwsgi_error_open(x) uwsgi_log("open(\"%s\"): %s [%s line %d]\n", x, strerror(errno), __FILE__, __LINE__); #define uwsgi_debug(x, ...) uwsgi_log("[uWSGI DEBUG] " x, __VA_ARGS__); #define uwsgi_rawlog(x) if (write(2, x, strlen(x)) != strlen(x)) uwsgi_error("write()") +#define uwsgi_str(x) uwsgi_concat2(x, "") #define uwsgi_notify(x) if (uwsgi.notify) uwsgi.notify(x) #define uwsgi_notify_ready() if (uwsgi.notify_ready) uwsgi.notify_ready()