diff --git a/core/async.c b/core/async.c index fb11e5a2..5cf9ac3f 100644 --- a/core/async.c +++ b/core/async.c @@ -389,6 +389,7 @@ void async_loop() { while (uwsgi.wsgi_req->waiting_fds) { tmp_uaf = uwsgi.wsgi_req->waiting_fds; uwsgi.async_waiting_fd_table[tmp_uaf->fd] = NULL; + event_queue_del_fd(uwsgi.async_queue, tmp_uaf->fd, tmp_uaf->event); uwsgi.wsgi_req->waiting_fds = tmp_uaf->next; free(tmp_uaf); } @@ -425,6 +426,7 @@ void async_loop() { while (uwsgi.wsgi_req->waiting_fds) { tmp_uaf = uwsgi.wsgi_req->waiting_fds; uwsgi.async_waiting_fd_table[tmp_uaf->fd] = NULL; + event_queue_del_fd(uwsgi.async_queue, tmp_uaf->fd, tmp_uaf->event); uwsgi.wsgi_req->waiting_fds = tmp_uaf->next; free(tmp_uaf); } diff --git a/core/protocol.c b/core/protocol.c index 9f1442f8..b3a6e7ee 100644 --- a/core/protocol.c +++ b/core/protocol.c @@ -1040,6 +1040,7 @@ next: } sse = sse->next; } + // check if a file named uwsgi.check_static+env['PATH_INFO'] exists udd = uwsgi.check_static; while(udd) { diff --git a/core/utils.c b/core/utils.c index a8de0dc3..dbe5f5fd 100644 --- a/core/utils.c +++ b/core/utils.c @@ -1491,7 +1491,7 @@ int uwsgi_get_app_id(char *app_name, int app_name_len, int modifier1) { } if (found) { - if (uwsgi_apps[i].touch_reload) { + if (uwsgi_apps[i].touch_reload[0]) { if (!stat(uwsgi_apps[i].touch_reload, &st)) { if (st.st_mtime != uwsgi_apps[i].touch_reload_mtime) { // serve the new request and reload diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index 1f5f3d86..6238cf15 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -416,7 +416,6 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } - if ( (wsgi_req->app_id = uwsgi_get_app_id(wsgi_req->appid, wsgi_req->appid_len, 0)) == -1) { wsgi_req->app_id = uwsgi.default_app; if (uwsgi.no_default_app) { @@ -454,6 +453,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { wi = &uwsgi_apps[wsgi_req->app_id]; up.swap_ts(wsgi_req, wi); + if (wi->chdir[0] != 0) { #ifdef UWSGI_DEBUG @@ -473,8 +473,10 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { // create WSGI environ wsgi_req->async_environ = up.wsgi_env_create(wsgi_req, wi); + wsgi_req->async_result = wi->request_subhandler(wsgi_req, wi); + if (wsgi_req->async_result) { diff --git a/plugins/python/wsgi_subhandler.c b/plugins/python/wsgi_subhandler.c index e6424deb..7c486873 100644 --- a/plugins/python/wsgi_subhandler.c +++ b/plugins/python/wsgi_subhandler.c @@ -6,6 +6,7 @@ extern PyTypeObject uwsgi_InputType; void *uwsgi_request_subhandler_wsgi(struct wsgi_request *wsgi_req, struct uwsgi_app *wi) { + PyObject *zero; int i; PyObject *pydictkey, *pydictvalue;