diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h index 1c775316..4e0b00ee 100644 --- a/plugins/python/uwsgi_python.h +++ b/plugins/python/uwsgi_python.h @@ -14,10 +14,6 @@ #define LONG_ARGS_PYMODULE_ALIAS LONG_ARGS_PYTHON_BASE + 4 #define LONG_ARGS_RELOAD_OS_ENV LONG_ARGS_PYTHON_BASE + 5 -#ifdef UWSGI_STACKLESS -#include -#endif - #if PY_MINOR_VERSION == 4 && PY_MAJOR_VERSION == 2 #define Py_ssize_t ssize_t #endif @@ -161,10 +157,6 @@ PyObject *py_eventfd_read(PyObject *, PyObject *); PyObject *py_eventfd_write(PyObject *, PyObject *); -#ifdef UWSGI_STACKLESS -PyObject *py_uwsgi_stackless(PyObject *, PyObject *); -#endif - int manage_python_response(struct wsgi_request *); int uwsgi_python_call(struct wsgi_request *, PyObject *, PyObject *); PyObject *python_call(PyObject *, PyObject *, int); @@ -178,18 +170,6 @@ ssize_t uwsgi_do_sendfile(int, int, size_t, size_t, off_t*, int); PyObject *py_uwsgi_write(PyObject *, PyObject *); PyObject *py_uwsgi_spit(PyObject *, PyObject *); -#ifdef UWSGI_STACKLESS -struct stackless_req { - PyTaskletObject *tasklet; - struct wsgi_request *wsgi_req; - PyChannelObject *channel; -}; -struct wsgi_request *find_request_by_tasklet(PyTaskletObject *); - -void stackless_init(void); -void stackless_loop(void); -#endif - void init_pyargv(void); #ifdef UWSGI_WEB3 diff --git a/stackless.c b/stackless.c index aaa4b3e8..f77badc5 100644 --- a/stackless.c +++ b/stackless.c @@ -2,6 +2,11 @@ #include "uwsgi.h" +#ifdef UWSGI_STACKLESS +#include +#endif + + extern struct uwsgi_server uwsgi; struct wsgi_request* find_request_by_tasklet(PyTaskletObject *tasklet) { diff --git a/utils.c b/utils.c index 09ee6ac0..677655c2 100644 --- a/utils.c +++ b/utils.c @@ -566,21 +566,6 @@ polling: return -1; } -#ifdef UWSGI_STACKLESS -inline struct wsgi_request *current_wsgi_req() { - - struct wsgi_request *wsgi_req = uwsgi.wsgi_req; - - if (uwsgi.stackless && uwsgi.async >1) { - PyThreadState *ts = PyThreadState_GET(); - wsgi_req = find_request_by_tasklet(ts->st.current); - } - - return wsgi_req; - -} -#endif - void sanitize_args() { if (uwsgi.async > 1) { diff --git a/uwsgi.h b/uwsgi.h index b6070244..ae668715 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1324,15 +1324,7 @@ int wsgi_req_simple_recv(struct wsgi_request *); int wsgi_req_accept(struct wsgi_request *); int wsgi_req_simple_accept(struct wsgi_request *, int); -#ifdef UWSGI_STACKLESS -#ifdef __clang__ -struct wsgi_request *current_wsgi_req(void); -#else -inline struct wsgi_request *current_wsgi_req(void); -#endif -#else #define current_wsgi_req() (*uwsgi.current_wsgi_req)() -#endif void sanitize_args(void);