mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-01 11:15:57 +00:00
implemented reliable gevent non-blocking writes
This commit is contained in:
@@ -9,6 +9,12 @@ extern struct http_status_codes hsc[];
|
||||
|
||||
extern PyTypeObject uwsgi_InputType;
|
||||
|
||||
void python_simple_hook_write_string(struct wsgi_request *wsgi_req, PyObject *str) {
|
||||
UWSGI_RELEASE_GIL
|
||||
wsgi_req->response_size += wsgi_req->socket->proto_write(wsgi_req, PyString_AsString(str), PyString_Size(str));
|
||||
UWSGI_GET_GIL
|
||||
}
|
||||
|
||||
void uwsgi_opt_pythonpath(char *opt, char *value, void *foobar) {
|
||||
|
||||
int i;
|
||||
@@ -232,6 +238,8 @@ pep405:
|
||||
up.wsgi_spitout = PyCFunction_New(uwsgi_spit_method, NULL);
|
||||
up.wsgi_writeout = PyCFunction_New(uwsgi_write_method, NULL);
|
||||
|
||||
up.hook_write_string = python_simple_hook_write_string;
|
||||
|
||||
up.main_thread = PyThreadState_Get();
|
||||
|
||||
// by default set a fake GIL (little impact on performance)
|
||||
|
||||
Reference in New Issue
Block a user