bug in wsgi.py? (wsgi.input read)

161 views
Skip to first unread message

datrus

unread,
Feb 20, 2011, 3:23:22 AM2/20/11
to Tornado Web Server
I'm running a tornado wsgi app on the wsgiref.simple_server on jython.
I found that when posting data to the app, tornado always hangs when
reading the POST data.
I think that to fix this, in wsgi.py on line 120, the following:

self.body = environ["wsgi.input"].read()

should be replaced by:

self.body = environ["wsgi.input"].read(self.headers["Content-Length"])

(otherwise tornado will wait for the connection to close when all the
post data has been read already)

David Janssens

Ben Darnell

unread,
Feb 22, 2011, 4:03:36 PM2/22/11
to python-...@googlegroups.com, datrus
Looks like you're right.  Fixed.

FYI, WSGIApplication has had very little testing (only on google app engine as far as I know), so you may run in to other little issues like this when running in another WSGI container.

-Ben
Reply all
Reply to author
Forward
0 new messages