
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.
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.