Files
deb-python-eventlet/tests
Samuel Merritt f1e4d33d02 wsgi: suppress output of 0-byte chunks
Under certain conditions, if the WSGI iterable yields an empty string,
it can cause the response to be terminated.

The conditions are as follows:

  * no minimum chunk size (eventlet.wsgi.server() was called with
    minimum_chunk_size=0, or
    env['eventlet.minimum_write_chunk_size'] = 0)

  * chunked transfer-encoding on the response

In this case, if the WSGI iterable yields an empty string, then
eventlet.wsgi obligingly turns that into "0\r\n\r\n" and writes that
to the socket. This, of course, terminates the response as far as the
client is concerned. However, eventlet.wsgi doesn't notice, so it'll
happily keep calling next(app_iter) and sending the chunks.

If Connection: keep-alive is set, the client might then send the next
request, read some chunked response body, fail to parse it, and then
disconnect.

In other cases, either the 0-byte chunk is saved in the chunk buffer
until the minimum chunk size is met, or 0 bytes get written to the
socket. Those are both no-ops.

This commit discards 0-byte chunks from the WSGI iterable.
2015-10-08 17:58:23 -07:00
..
2014-11-12 09:05:10 +00:00
2014-08-27 10:21:55 +04:00
2014-08-27 10:21:55 +04:00
2014-04-24 18:11:37 +04:00
2014-10-11 01:41:30 +01:00
2014-08-27 10:21:55 +04:00
2014-10-11 01:41:30 +01:00
2014-10-10 08:53:11 +01:00
2014-08-27 10:21:55 +04:00
2014-08-27 10:21:55 +04:00
2014-08-27 10:21:55 +04:00
2014-08-27 10:21:55 +04:00
2014-07-18 02:12:53 +04:00

The tests are intended to be run using Nose.  
http://somethingaboutorange.com/mrl/projects/nose/

To run tests, simply install nose, and then, in the eventlet tree, do:
   $ nosetests

That's it!  Its output is the same as unittest's output.  It tends to emit a lot of tracebacks from various poorly-behaving tests, but they still (generally) pass.