diff --git a/event.c b/event.c index 414f8888..97d598ac 100644 --- a/event.c +++ b/event.c @@ -259,7 +259,7 @@ int event_queue_interesting_fd(void *events, int id) { int event_queue_interesting_fd_has_error(void *events, int id) { struct epoll_event *ee = (struct epoll_event *) events; - if (ee[id].events == EPOLLHUP || ee[id].events == EPOLLERR || (ee[id].events == (EPOLLERR|EPOLLHUP))) { + if (ee[id].events & EPOLLHUP || ee[id].events & EPOLLERR) { return 1; } return 0; diff --git a/plugins/python/wsgi_handlers.c b/plugins/python/wsgi_handlers.c index 7f3501fb..6d2ae53a 100644 --- a/plugins/python/wsgi_handlers.c +++ b/plugins/python/wsgi_handlers.c @@ -445,7 +445,11 @@ int uwsgi_request_wsgi(struct wsgi_request *wsgi_req) { } if (!up.pep3333_input) { +#ifdef PYTHREE + wsgi_socket = PyFile_FromFd(fileno(wsgi_req->async_post), "wsgi_input", "rb", 0, NULL, NULL, NULL, 0); +#else wsgi_socket = PyFile_FromFile(wsgi_req->async_post, "wsgi_input", "r", NULL); +#endif PyDict_SetItemString(wsgi_req->async_environ, "wsgi.input", wsgi_socket); Py_DECREF(wsgi_socket); }