From e393f36f0adbdb49e4a84098865bb6e3c01785e4 Mon Sep 17 00:00:00 2001 From: "roberto@mrspurr" Date: Sun, 22 Jul 2012 11:21:08 +0200 Subject: [PATCH] fixed env clear in async mode --- plugins/python/wsgi_handlers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index bfa374e8..28b98746 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -341,6 +341,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { #ifdef UWSGI_ASYNC if (wsgi_req->async_status == UWSGI_AGAIN) { + wi = &uwsgi_apps[wsgi_req->app_id]; UWSGI_GET_GIL // get rid of timeout if (wsgi_req->async_timed_out) { @@ -359,6 +360,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { PyDict_SetItemString(wsgi_req->async_environ, "uwsgi.ready_fd", Py_None); } int ret = manage_python_response(wsgi_req); + if (ret == UWSGI_OK) goto end; UWSGI_RELEASE_GIL return ret; } @@ -508,6 +510,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } // this object must be freed/cleared always +end: if (wsgi_req->async_input) { Py_DECREF((PyObject *)wsgi_req->async_input); }