From 57d4cd9fc921b93763cbffa0334dfbb46ffc06d5 Mon Sep 17 00:00:00 2001 From: "roberto@precise64" Date: Wed, 28 Mar 2012 11:08:04 +0200 Subject: [PATCH] gevent fixes --- hello_world.py | 5 +++++ plugins/gevent/gevent.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hello_world.py b/hello_world.py index a1c5b18d..a5119194 100644 --- a/hello_world.py +++ b/hello_world.py @@ -1,10 +1,15 @@ import uwsgi +if uwsgi.loop == 'gevent': + import gevent + print uwsgi.version print uwsgi.workers() uwsgi.cache_set('foo', "Hello World from cache") def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) yield "foobar
" + if uwsgi.loop == 'gevent': + gevent.sleep(10) yield str(env['wsgi.input'].fileno()) yield "

Hello World

" yield uwsgi.cache_get('foo') diff --git a/plugins/gevent/gevent.c b/plugins/gevent/gevent.c index 08e26f35..6c58b513 100644 --- a/plugins/gevent/gevent.c +++ b/plugins/gevent/gevent.c @@ -107,7 +107,6 @@ PyObject *py_uwsgi_gevent_main(PyObject * self, PyObject * args) { // accept the connection if (wsgi_req_simple_accept(wsgi_req, uwsgi.sockets->fd)) { - uwsgi_close_request(wsgi_req); free_req_queue; goto clear; }