mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
improved the pyshell
This commit is contained in:
@@ -300,7 +300,7 @@ int uwsgi_response_subhandler_pump(struct wsgi_request *wsgi_req) {
|
||||
}
|
||||
|
||||
wsgi_req->socket->proto_write(wsgi_req, "\r\n", 2);
|
||||
Py_INCREF(wsgi_req->async_placeholder);
|
||||
Py_INCREF((PyObject *)wsgi_req->async_placeholder);
|
||||
|
||||
if (PyString_Check((PyObject *)wsgi_req->async_placeholder)) {
|
||||
if ((wsize = wsgi_req->socket->proto_write(wsgi_req, PyString_AsString(wsgi_req->async_placeholder), PyString_Size(wsgi_req->async_placeholder))) < 0) {
|
||||
|
||||
@@ -1226,7 +1226,8 @@ void uwsgi_python_fixup() {
|
||||
}
|
||||
|
||||
void uwsgi_python_hijack(void) {
|
||||
if (up.pyshell) {
|
||||
// the pyshell will be execute only in the first worker
|
||||
if (up.pyshell && uwsgi.mywid == 1) {
|
||||
PyImport_ImportModule("readline");
|
||||
PyRun_InteractiveLoop(stdin, "uwsgi");
|
||||
exit(0);
|
||||
|
||||
@@ -149,7 +149,7 @@ int uwsgi_response_subhandler_web3(struct wsgi_request *wsgi_req) {
|
||||
|
||||
|
||||
wsgi_req->async_placeholder = PyTuple_GetItem((PyObject *)wsgi_req->async_result, 0);
|
||||
Py_INCREF(wsgi_req->async_placeholder);
|
||||
Py_INCREF((PyObject *)wsgi_req->async_placeholder);
|
||||
|
||||
PyObject *spit_args = PyTuple_New(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user