@@ -1166,7 +1166,9 @@ void uwsgi_python_init_apps() {
11661166
11671167 // prepare for stack suspend/resume
11681168 if (uwsgi .async > 1 ) {
1169- #ifdef UWSGI_PY312
1169+ #ifdef UWSGI_PY314
1170+ up .current_py_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
1171+ #elif defined UWSGI_PY312
11701172 up .current_c_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
11711173 up .current_py_recursion_remaining = uwsgi_malloc (sizeof (int )* uwsgi .async );
11721174#elif defined UWSGI_PY311
@@ -1608,7 +1610,10 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) {
16081610 PyGILState_Release (pgst );
16091611
16101612 if (wsgi_req ) {
1611- #ifdef UWSGI_PY313
1613+ #ifdef UWSGI_PY314
1614+ up .current_py_recursion_remaining [wsgi_req -> async_id ] = tstate -> py_recursion_remaining ;
1615+ up .current_frame [wsgi_req -> async_id ] = tstate -> current_frame ;
1616+ #elif defined UWSGI_PY313
16121617 up .current_c_recursion_remaining [wsgi_req -> async_id ] = tstate -> c_recursion_remaining ;
16131618 up .current_py_recursion_remaining [wsgi_req -> async_id ] = tstate -> py_recursion_remaining ;
16141619 up .current_frame [wsgi_req -> async_id ] = tstate -> current_frame ;
@@ -1625,7 +1630,10 @@ void uwsgi_python_suspend(struct wsgi_request *wsgi_req) {
16251630#endif
16261631 }
16271632 else {
1628- #ifdef UWSGI_PY313
1633+ #ifdef UWSGI_PY314
1634+ up .current_main_py_recursion_remaining = tstate -> py_recursion_remaining ;
1635+ up .current_main_frame = tstate -> current_frame ;
1636+ #elif defined UWSGI_PY313
16291637 up .current_main_c_recursion_remaining = tstate -> c_recursion_remaining ;
16301638 up .current_main_py_recursion_remaining = tstate -> py_recursion_remaining ;
16311639 up .current_main_frame = tstate -> current_frame ;
@@ -1869,7 +1877,10 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) {
18691877 PyGILState_Release (pgst );
18701878
18711879 if (wsgi_req ) {
1872- #ifdef UWSGI_PY313
1880+ #ifdef UWSGI_PY314
1881+ tstate -> py_recursion_remaining = up .current_py_recursion_remaining [wsgi_req -> async_id ];
1882+ tstate -> current_frame = up .current_frame [wsgi_req -> async_id ];
1883+ #elif defined UWSGI_PY313
18731884 tstate -> c_recursion_remaining = up .current_c_recursion_remaining [wsgi_req -> async_id ];
18741885 tstate -> py_recursion_remaining = up .current_py_recursion_remaining [wsgi_req -> async_id ];
18751886 tstate -> current_frame = up .current_frame [wsgi_req -> async_id ];
@@ -1886,7 +1897,10 @@ void uwsgi_python_resume(struct wsgi_request *wsgi_req) {
18861897#endif
18871898 }
18881899 else {
1889- #ifdef UWSGI_PY313
1900+ #ifdef UWSGI_PY314
1901+ tstate -> py_recursion_remaining = up .current_main_py_recursion_remaining ;
1902+ tstate -> current_frame = up .current_main_frame ;
1903+ #elif defined UWSGI_PY313
18901904 tstate -> c_recursion_remaining = up .current_main_c_recursion_remaining ;
18911905 tstate -> py_recursion_remaining = up .current_main_py_recursion_remaining ;
18921906 tstate -> current_frame = up .current_main_frame ;
0 commit comments