diff --git a/async.c b/async.c index 4e3774d6..0a7e52a7 100644 --- a/async.c +++ b/async.c @@ -438,8 +438,6 @@ struct wsgi_request * async_loop() { uwsgi.wsgi_req = wsgi_req ; wsgi_req->async_status = (*uwsgi.shared->hooks[wsgi_req->uh.modifier1]) (wsgi_req); - wsgi_req->async_switches++; - if (wsgi_req->async_status < UWSGI_AGAIN) { return wsgi_req; } diff --git a/logging.c b/logging.c index efc511b2..9b5c311c 100644 --- a/logging.c +++ b/logging.c @@ -104,7 +104,7 @@ void log_request(struct wsgi_request *wsgi_req) { wsgi_req->status, wsgi_req->header_cnt, wsgi_req->headers_size, - wsgi_req->async_switches, wsgi_req->async_id); + wsgi_req->switches, wsgi_req->async_id); logvec[logvecpos].iov_base = logpkt ; logvec[logvecpos].iov_len = rlen ; diff --git a/ugreen.c b/ugreen.c index 677c4262..896bb6ee 100644 --- a/ugreen.c +++ b/ugreen.c @@ -85,7 +85,7 @@ inline static void u_green_schedule_to_req(struct uwsgi_server *uwsgi, struct ws py_current_frame = tstate->frame; uwsgi->wsgi_req = wsgi_req; - wsgi_req->async_switches++; + //wsgi_req->async_switches++; swapcontext(&uwsgi->ugreenmain, uwsgi->ugreen_contexts[wsgi_req->async_id] ); tstate = PyThreadState_GET(); diff --git a/uwsgi.h b/uwsgi.h index 2faedb00..a1eecd53 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -473,7 +473,8 @@ struct wsgi_request { int async_waiting_fd; int async_waiting_fd_type; int async_waiting_fd_monitored; - int async_switches; + + int switches; time_t async_timeout ; int async_timeout_expired ; diff --git a/wsgi_handlers.c b/wsgi_handlers.c index 6f90be39..04dec970 100644 --- a/wsgi_handlers.c +++ b/wsgi_handlers.c @@ -299,6 +299,7 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { while ( (*wi->response_subhandler)(wsgi_req) != UWSGI_OK) { + wsgi_req->switches++; #ifdef UWSGI_ASYNC if (uwsgi.async > 1) { return UWSGI_AGAIN;