diff --git a/core/uwsgi.c b/core/uwsgi.c index 1d8aa4c2..513dcb5b 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -2421,9 +2421,12 @@ next: if (!uwsgi.master_process && uwsgi.numproc == 0) { exit(0); } + +#ifdef UWSGI_MINTERPRETERS if (!uwsgi.single_interpreter && uwsgi.numproc > 0) { uwsgi_log("*** uWSGI is running in multiple interpreter mode ***\n"); } +#endif // check for request plugins, and eventually print a warning int rp_available = 0; diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c index 681551f2..e7b2a014 100644 --- a/plugins/python/pyloader.c +++ b/plugins/python/pyloader.c @@ -483,7 +483,9 @@ PyObject *uwsgi_uwsgi_loader(void *arg1) { PyObject *tmp_callable; PyObject *applications; +#ifdef UWSGI_EMBEDDED PyObject *uwsgi_dict = get_uwsgi_pydict("uwsgi"); +#endif char *module = (char *) arg1; @@ -506,8 +508,10 @@ PyObject *uwsgi_uwsgi_loader(void *arg1) { return NULL; } +#ifdef UWSGI_EMBEDDED applications = PyDict_GetItemString(uwsgi_dict, "applications"); if (applications && PyDict_Check(applications)) return applications; +#endif applications = PyDict_GetItemString(wsgi_dict, "applications"); if (applications && PyDict_Check(applications)) return applications; diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index 0539a9f5..1bd165cb 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -282,6 +282,7 @@ realstuff: if (uwsgi.has_threads) PyGILState_Ensure(); // no need to worry about freeing memory +#ifdef UWSGI_EMBEDDED PyObject *uwsgi_dict = get_uwsgi_pydict("uwsgi"); if (uwsgi_dict) { PyObject *ae = PyDict_GetItemString(uwsgi_dict, "atexit"); @@ -289,6 +290,7 @@ realstuff: python_call(ae, PyTuple_New(0), 0, NULL); } } +#endif // this part is a 1:1 copy of mod_wsgi 3.x // it is required to fix some atexit bug with python 3 @@ -1165,6 +1167,7 @@ next: } #endif +#ifdef UWSGI_EMBEDDED PyObject *uwsgi_dict = get_uwsgi_pydict("uwsgi"); if (uwsgi_dict) { up.after_req_hook = PyDict_GetItemString(uwsgi_dict, "after_req_hook"); @@ -1174,6 +1177,7 @@ next: Py_INCREF(up.after_req_hook_args); } } +#endif // lazy ? if (uwsgi.mywid > 0) { diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index b288cc28..8b9d7cf5 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -510,7 +510,9 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } // this object must be freed/cleared always +#ifdef UWSGI_ASYNC end: +#endif if (wsgi_req->async_input) { Py_DECREF((PyObject *)wsgi_req->async_input); }