Ben Darnell [Sun, 31 Aug 2014 02:52:54 +0000 (22:52 -0400)]
Limit the number of connections we will accept per call to accept_handler.
This ensures that other callbacks scheduled on the IOLoop have a chance
to run. This shows up as increased memory usage in benchmark scenarios
(since 4.0 allowed simple http transactions to be processed synchronously).
Ben Darnell [Sat, 23 Aug 2014 22:12:19 +0000 (18:12 -0400)]
Fix a regression in gzip output for StaticFileHandler.
Streaming static responses confused the gzip output transform since
it could no longer set the correct outgoing content-length. Now
it will fall back to chunked encoding in this case.
Niko Wilbert [Fri, 22 Aug 2014 08:48:42 +0000 (10:48 +0200)]
Fixed support for test generators
This fixes the problem that AsyncTestCase no longer seemed to work with test generators (as supported by Nose, http://nose.readthedocs.org/en/latest/writing_tests.html#test-generators).
Ben Darnell [Sun, 10 Aug 2014 18:02:39 +0000 (14:02 -0400)]
Correctly handle 204 response codes that do not include a content-length.
If a server sends a 204 with no content-length we would wait for the server
to close the connection instead of ending the request (any such servers
are ignoring the "Connection: close" header we send, but apparently exist).
Move some content-length logic from simple_httpclient.py to http1connection.py.
Fix the client-side use of on_connection_close; this affects the
handling of any HTTPInputException.
Ben Darnell [Sun, 10 Aug 2014 18:02:39 +0000 (14:02 -0400)]
Correctly handle 204 response codes that do not include a content-length.
If a server sends a 204 with no content-length we would wait for the server
to close the connection instead of ending the request (any such servers
are ignoring the "Connection: close" header we send, but apparently exist).
Move some content-length logic from simple_httpclient.py to http1connection.py.
Fix the client-side use of on_connection_close; this affects the
handling of any HTTPInputException.
Ben Darnell [Tue, 5 Aug 2014 03:46:03 +0000 (23:46 -0400)]
Fix a memory leak and test timeout in websockets.
In some cases (primarily when prepare() is asynchronous), an
HTTP1ServerConnection could be left waiting forever for a connection
to finish when that connection has been detached and handed off to a
WebSocketHandler. This would manifest as a leak and a timeout in
tests as the HTTPServer waited for all its existing connections to
finish.
Also fix a bug in the test tearDown method that would actually
wait forever for connections to finish instead of timing out.
Ben Darnell [Sun, 27 Jul 2014 05:26:11 +0000 (01:26 -0400)]
Implement permessage-deflate websocket extension.
Parameters to the extension are not fully supported (the client side
supports client_no_context_takeover which is mandatory to implement,
but the server rejects any parameters offered by the client, and neither
side supports setting wbits).
Tom Arnfeld [Wed, 23 Jul 2014 17:27:03 +0000 (18:27 +0100)]
Fixed a bug with keep-alive chunked requests
If you make a POST request with 'Connection: Keep-Alive' and use chunked body encoding, tornado will not interpret that as a connection that can be kept alive, and will close the connection.
Tom Arnfeld [Tue, 22 Jul 2014 16:50:16 +0000 (17:50 +0100)]
Support for non-RFC compliant header prefixes
When using keep-alive connections, some HTTP implementations insert unexpected and extra CRLF tokens between each connection, which can result in the next request being prefixed with a CRLF.
Some other client/server implementations are tollerant of this, and for example this bug doesn't show up when using the Go net/http library.
Move patch test to httpclient_test, according to @bdarnell recommendation
using httpclient_test.py instead of curl_httpclient_test.py so simple_httpclient_test.py is benefit from it as well
#1090
Per Kraulis [Thu, 10 Jul 2014 13:47:28 +0000 (15:47 +0200)]
Fixes bug disallowing custom-made reason phrase
The send_error method is, I believe, supposed to allow sending an HTTP reason phrase that is not one of the standard ones. This change corrects an apparent bug which made this impossible. With the correction, specifying an 'error' keyword argument to send_error actually sends the specified
reason phrase to the client.