Skip to content

Commit

Permalink
Merge pull request #1 from tornadoweb/master
Browse files Browse the repository at this point in the history
update from upstream
  • Loading branch information
zhicheng committed Aug 7, 2014
2 parents 2d6c02a + afc3dde commit 692e76d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Release notes
.. toctree::
:maxdepth: 2

releases/next
releases/v4.0.0
releases/v3.2.2
releases/v3.2.1
Expand Down
36 changes: 36 additions & 0 deletions docs/releases/next.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
What's new in the next release of Tornado
=========================================

In progress
-----------

* `~tornado.options.parse_config_file` now always decodes the config
file as utf8 on Python 3.
* ``tornado.curl_httpclient`` now supports request bodies for ``PATCH``
and custom methods.
* `.RequestHandler.send_error` now supports a ``reason`` keyword
argument, similar to `tornado.web.HTTPError`.
* ``tornado.curl_httpclient`` now supports resubmitting bodies after
following redirects for methods other than ``POST``.
* The build will now fall back to pure-python mode if the C extension
fails to build for any reason (previously it would fall back for some
errors but not others).
* The ``context`` argument to `.HTTPServerRequest` is now optional,
and if a context is supplied the ``remote_ip`` attribute is also optional.
* `.IOLoop.call_at` and `.IOLoop.call_later` now always return
a timeout handle for use with `.IOLoop.remove_timeout`.
* `.HTTPServer` now tolerates extra newlines which are sometimes inserted
between requests on keep-alive connections.
* `.HTTPServer` can now use keep-alive connections after a request
with a chunked body.
* `.SSLIOStream` will no longer consume 100% CPU after certain error conditions.
* `.SSLIOStream` no longer logs ``EBADF`` errors during the handshake as they
can result from nmap scans in certain modes.
* The `tornado.websocket` module now supports compression via the
"permessage-deflate" extension. Override
`.WebSocketHandler.get_compression_options` to enable on the server
side, and use the ``compression_options`` keyword argument to
`.websocket_connect` on the client side.
* If the callback of a `.PeriodicCallback` returns a `.Future`, any error
raised in that future will now be logged (similar to the behavior of
`.IOLoop.add_callback`).
1 change: 1 addition & 0 deletions docs/websocket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
-------------

.. automethod:: WebSocketHandler.check_origin
.. automethod:: WebSocketHandler.get_compression_options
.. automethod:: WebSocketHandler.set_nodelay

Other
Expand Down
16 changes: 16 additions & 0 deletions tornado/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ def select_subprotocol(self, subprotocols):
return None

def get_compression_options(self):
"""Override to return compression options for the connection.
If this method returns None (the default), compression will
be disabled. If it returns a dict (even an empty one), it
will be enabled. The contents of the dict may be used to
control the memory and CPU usage of the compression,
but no such options are currently implemented.
.. versionadded:: 4.1
"""
return None

def open(self):
Expand Down Expand Up @@ -960,8 +970,14 @@ def websocket_connect(url, io_loop=None, callback=None, connect_timeout=None,
Takes a url and returns a Future whose result is a
`WebSocketClientConnection`.
``compression_options`` is interpreted in the same way as the
return value of `.WebSocketHandler.get_compression_options`.
.. versionchanged:: 3.2
Also accepts ``HTTPRequest`` objects in place of urls.
.. versionchanged:: 4.1
Added ``compression_options``.
"""
if io_loop is None:
io_loop = IOLoop.current()
Expand Down

0 comments on commit 692e76d

Please sign in to comment.