diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c index 99c03919..0f2fb752 100644 --- a/plugins/python/pyloader.c +++ b/plugins/python/pyloader.c @@ -125,7 +125,6 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre } } - if (interpreter == NULL && id) { wi->interpreter = Py_NewInterpreter(); if (!wi->interpreter) { diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c index edb0ce36..2bef206e 100644 --- a/plugins/python/python_plugin.c +++ b/plugins/python/python_plugin.c @@ -778,6 +778,7 @@ void uwsgi_python_init_apps() { init_uwsgi_app(LOADER_EVAL, up.eval, uwsgi.wsgi_req, up.main_thread); } + } void uwsgi_python_enable_threads() { diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index 6d2ae53a..d02447a9 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -293,7 +293,6 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { || wsgi_req->file_len > 0 || wsgi_req->paste_len > 0 ) { - // a bit of magic: 1-1 = 0 / 0-1 = -1 // this part must be heavy locked in threaded modes if (uwsgi.threads > 1) { pthread_mutex_lock(&up.lock_pyloaders); diff --git a/uwsgi.c b/uwsgi.c index 52bf708f..2f557ec7 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -1944,6 +1944,10 @@ uwsgi.shared->hooks[UWSGI_MODIFIER_PING] = uwsgi_request_ping; //100 } } + // no app initialized and virtualhosting enabled + if (uwsgi.apps_cnt == 0 && uwsgi.vhost) { + uwsgi.apps_cnt = 1; + } if (uwsgi.no_server) { uwsgi_log("no-server mode requested. Goodbye.\n");