diff --git a/evdis.c b/evdis.c
new file mode 100644
index 00000000..911b3147
--- /dev/null
+++ b/evdis.c
@@ -0,0 +1,15 @@
+#ifdef UWSGI_EVDIS
+
+#include "uwsgi.h"
+
+void evdis_loop(struct uwsgi_server *uwsgi) {
+
+ // populate event list
+
+}
+
+
+
+#else
+#warning "*** Event Dispatcher support is disabled ***"
+#endif
diff --git a/protocol.c b/protocol.c
index 658adeca..d03cb550 100644
--- a/protocol.c
+++ b/protocol.c
@@ -266,6 +266,10 @@ int uwsgi_parse_response(struct pollfd *upoll, int timeout, struct uwsgi_header
uh->pktsize = uwsgi_swap16(uh->pktsize);
#endif
+#ifdef UWSGI_DEBUG
+ uwsgi_debug("uwsgi payload size: %d (%X) modifier1: %d modifier2: %d\n", uh->pktsize, uh->pktsize, uh->modifier1, uh->modifier2);
+#endif
+
/* check for max buffer size */
if (uh->pktsize > uwsgi.buffer_size) {
uwsgi_log( "invalid request block size: %d...skip\n", uh->pktsize);
diff --git a/pyutils.c b/pyutils.c
index c7f91f10..1f2b7bd8 100644
--- a/pyutils.c
+++ b/pyutils.c
@@ -45,6 +45,21 @@ int manage_python_response(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi
}
#endif
+#ifdef UWSGI_WSGI2
+ // is it a tuple (WSGI2.0) ?
+ if (PyTuple_Check((PyObject *)wsgi_req->async_result)) {
+ if (PyTuple_Size((PyObject *)wsgi_req->async_result) != 3) {
+ uwsgi_log("invalid WSGI2.0 response.\n");
+ goto clear;
+ }
+ if (py_uwsgi_spit(NULL, (PyObject *)wsgi_req->async_result) == Py_None) {
+ goto clear;
+ }
+ wsgi_req->async_orig_result = wsgi_req->async_result ;
+ wsgi_req->async_result = PyTuple_GetItem((PyObject *)wsgi_req->async_result, 2);
+ return UWSGI_AGAIN;
+ }
+#endif
// ok its a yield
if (!wsgi_req->async_placeholder) {
@@ -61,7 +76,6 @@ int manage_python_response(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi
-
pychunk = PyIter_Next(wsgi_req->async_placeholder) ;
if (!pychunk) {
@@ -108,6 +122,9 @@ clear:
}
}
Py_XDECREF((PyObject *)wsgi_req->async_placeholder);
+#ifdef UWSGI_WSGI2
+ Py_XDECREF((PyObject *)wsgi_req->async_orig_result);
+#endif
clear2:
Py_DECREF((PyObject *)wsgi_req->async_result);
PyErr_Clear();
diff --git a/simple_app.py b/simple_app.py
index 7d7c720e..ca4cd095 100644
--- a/simple_app.py
+++ b/simple_app.py
@@ -1,3 +1,17 @@
+import uwsgi
+
+print "uWSGI version:", uwsgi.version
+
+def ciao():
+ print "modifica su /tmp"
+
+def ciao2():
+ print "nuovo uwsgi_server"
+
+#uwsgi.event_add(uwsgi.EVENT_FILE, "/tmp", ciao)
+#uwsgi.event_add(uwsgi.EVENT_DNSSD, "_uwsgi._tcp", ciao2)
+#uwsgi.event_add(uwsgi.EVENT_TIMER, 1000, ciao2)
+
def application(env, start_response):
print env
start_response('200 Ok', [('Content-type', 'text/plain')])
diff --git a/simple_app_wsgi2.py b/simple_app_wsgi2.py
new file mode 100644
index 00000000..41907dd9
--- /dev/null
+++ b/simple_app_wsgi2.py
@@ -0,0 +1,9 @@
+
+def mygen(uri):
+ for i in xrange(1,100):
+ yield "ciao %s
" % uri
+
+
+def application(env, start_response = None):
+ return '200 OK', [('Content-Type', 'text/html')], "