@@ -1213,7 +1213,9 @@ void uwsgi_python_init_apps() {
12131213
12141214 // prepare for stack suspend/resume
12151215 if (uwsgi .async > 0 ) {
1216- #ifdef UWSGI_PY312
1216+ #ifdef UWSGI_PY314
1217+ up .current_py_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
1218+ #elif defined UWSGI_PY312
12171219 up .current_c_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
12181220 up .current_py_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
12191221#elif defined UWSGI_PY311
@@ -1659,7 +1661,10 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) {
16591661 PyGILState_Release (pgst );
16601662
16611663 if (wsgi_req ) {
1662- #ifdef UWSGI_PY313
1664+ #ifdef UWSGI_PY314
1665+ up .current_py_recursion_remaining [wsgi_req -> async_id ] = tstate -> py_recursion_remaining ;
1666+ up .current_frame [wsgi_req -> async_id ] = tstate -> current_frame ;
1667+ #elif defined UWSGI_PY313
16631668 up .current_c_recursion_remaining [wsgi_req -> async_id ] = tstate -> c_recursion_remaining ;
16641669 up .current_py_recursion_remaining [wsgi_req -> async_id ] = tstate -> py_recursion_remaining ;
16651670 up .current_frame [wsgi_req -> async_id ] = tstate -> current_frame ;
@@ -1676,7 +1681,10 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) {
16761681#endif
16771682 }
16781683 else {
1679- #ifdef UWSGI_PY313
1684+ #ifdef UWSGI_PY314
1685+ up .current_main_py_recursion_remaining = tstate -> py_recursion_remaining ;
1686+ up .current_main_frame = tstate -> current_frame ;
1687+ #elif defined UWSGI_PY313
16801688 up .current_main_c_recursion_remaining = tstate -> c_recursion_remaining ;
16811689 up .current_main_py_recursion_remaining = tstate -> py_recursion_remaining ;
16821690 up .current_main_frame = tstate -> current_frame ;
@@ -1920,7 +1928,10 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) {
19201928 PyGILState_Release (pgst );
19211929
19221930 if (wsgi_req ) {
1923- #ifdef UWSGI_PY313
1931+ #ifdef UWSGI_PY314
1932+ tstate -> py_recursion_remaining = up .current_py_recursion_remaining [wsgi_req -> async_id ];
1933+ tstate -> current_frame = up .current_frame [wsgi_req -> async_id ];
1934+ #elif defined UWSGI_PY313
19241935 tstate -> c_recursion_remaining = up .current_c_recursion_remaining [wsgi_req -> async_id ];
19251936 tstate -> py_recursion_remaining = up .current_py_recursion_remaining [wsgi_req -> async_id ];
19261937 tstate -> current_frame = up .current_frame [wsgi_req -> async_id ];
@@ -1937,7 +1948,10 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) {
19371948#endif
19381949 }
19391950 else {
1940- #ifdef UWSGI_PY313
1951+ #ifdef UWSGI_PY314
1952+ tstate -> py_recursion_remaining = up .current_main_py_recursion_remaining ;
1953+ tstate -> current_frame = up .current_main_frame ;
1954+ #elif defined UWSGI_PY313
19411955 tstate -> c_recursion_remaining = up .current_main_c_recursion_remaining ;
19421956 tstate -> py_recursion_remaining = up .current_main_py_recursion_remaining ;
19431957 tstate -> current_frame = up .current_main_frame ;
0 commit comments