Permalink
Commits on Jun 8, 2012
  1. Refactor TCPServer and HTTPServer to support TLS NPN

    alekstorm committed Jun 8, 2012
    * TLS NPN means that one of many protocols can be selected after a TCP connection is established. A
      layer of indirection was added to TCPServer to allow it to delegate handling of a TCP connection
      to whichever protocol handler was negotiated. If the `npn_protocols` parameter (a list of
      (name, handler) tuples in order of preference) was passed to the constructor, the connection is
      over TLS, and NPN succeeded, the handler for the chosen name will be called. Otherwise, the
      `protocol` constructor parameter will be called. For example, SPDYServer is essentially:
    
      class SPDYServer(TCPServer):
          def __init__(self, request_callback):
              http_protocol = HTTPServerProtocol(request_callback)
              TCPServer.__init__(self, http_protocol,
                  npn_protocols=[
                      ('spdy/2', SPDYServerProtocol(request_callback)),
                      ('http/1.1', http_protocol)])
    
    * TCPServer was moved from netutil to its own module, tcpserver.
    
    * Since utilizing NPN support in Python 3.3 requires the `ssl.SSLContext` class, which isn't
      available in Python 2.x, the wrap_socket() top-level function was added to `netutil` to abstract
      away these details. In addition, the `SUPPORTS_NPN` constant was added as a convenience for
      determining if the system supported NPN.
    
    * Previously, `web.RequestHandler` formatted the HTTP response itself and wrote it directly to the
      IOStream. This responsibility has been moved to the HTTPRequest.connection object, which must
      provide the write_preamble() and write() methods - the former writes the response status line and
      headers, while the latter writes a chunk of the response body.
    
    * Although IOStream.connect() already takes a callback parameter, in SSLIOStream it's not called
      until the SSL handshake is completed (which contains TLS NPN) - and TCPServer, which doesn't call
      connect(), won't know which protocol handler to execute until that happens. To fix this, a
      set_connect_callback method was added to IOStream.
    
    * Snippets that conditionally imported BytesIO and ssl were moved into util and netutil,
      respectively. These symbols are now imported from there.
Commits on Jun 1, 2012
  1. Set version number to 2.3

    bdarnell committed Jun 1, 2012
  2. Final 2.3 release notes

    bdarnell committed Jun 1, 2012
Commits on May 31, 2012
  1. Merge pull request #521 from yoinc/master

    bdarnell committed May 31, 2012
    Restore context for all read methods
  2. Restore context for all read methods.

    eden committed May 31, 2012
    Prior to 2db0ace this was being done
    properly, but the refactor removed stack_context.wrap causing some issues
    in our upstream context managers.
Commits on May 28, 2012
  1. Set version number to 2.3rc1

    bdarnell committed May 28, 2012
  2. Doc updates

    bdarnell committed May 28, 2012
  3. Release note updates

    bdarnell committed May 28, 2012
  4. Remove unused variables

    bdarnell committed May 28, 2012
  5. Remove use of string exceptions in gen_test.

    bdarnell committed May 28, 2012
    These lines are not reached, but if they were they would fail with
    a less clear message than intended.
    
    Closes #520.
Commits on May 27, 2012
Commits on May 26, 2012
  1. Delay check for socket.family (and make it jython-friendly).

    bdarnell committed May 26, 2012
    Now HTTPConnection.address will always be the socket address,
    and the fake "0.0.0.0" IP is only used in contexts that want an IP
    (i.e. HTTPRequest.remote_ip) but the connection is a non-IP socket.
  2. Merge pull request #514 from ahassany/fix-connectin-check

    bdarnell committed May 26, 2012
    Better connection check in RequestHandler
Commits on May 25, 2012
  1. Split large chunks of data in IOStream.write.

    ei-grad committed May 24, 2012
    Closes #515.
Commits on May 24, 2012
Commits on May 21, 2012
  1. Prevent leak of StackContexts in repeated gen.engine functions.

    bdarnell committed May 21, 2012
    Internally, StackContexts now return a deactivation callback,
    which can be used to prevent that StackContext from propagating
    further.  This is used in gen.engine because the decorator doesn't know
    which arguments are callbacks that need to be wrapped outside of its
    ExceptionStackContext.  This is deliberately undocumented for now.
    
    Closes #507.
  2. Release note updates

    bdarnell committed May 21, 2012
Commits on May 20, 2012
  1. Fix docstring formatting

    bdarnell committed May 20, 2012
  2. Merge remote-tracking branch 'jjwchoy/master'

    bdarnell committed May 20, 2012
    Modified linkify to accept a callable for extra_params.
    
    Closes #506.
  3. 304 responses no longer include entity headers like Content-Length

    bdarnell committed May 20, 2012
    This is required by the RFC as it may confuse caches.
  4. Add status_code to the OutputTransform.transform_first_chunk interface.

    bdarnell committed May 20, 2012
    This is needed for correct support of the 304 status code, which
    has no body and should not have either a Content-Length or
    Transfer-Encoding.  This is a backwards-incompatible change to an
    interface that was never technically private, but not included in the
    documentation and as far as I can tell was never used outside
    tornado itself.
Commits on May 19, 2012
  1. Fight bitrot in tornado.platform.twisted.

    bdarnell committed May 19, 2012
    A new release of zope.interface breaks things on python 2.5, and
    sets off our (overly-sensitive?) deprecation checking.
Commits on May 12, 2012
  1. Move tornado.platform.windows.Waker to new module platform.common.

    bdarnell committed May 12, 2012
    Cleaned up the few windows-specific bits of code.  The socket-based
    Waker is also usable on Jython.
Commits on May 11, 2012
  1. Replace all occurrences of 3-argument raise statements with the

    bdarnell committed May 11, 2012
    version from testing.py, which works better with 2to3.
    
    Closes #508
Commits on May 10, 2012
  1. Fix path parsing in HTTPServer.

    bdarnell committed May 10, 2012
    urlparse.urlsplit expects a full url, but we were using it for a bare path.
    This mostly worked but would parse paths beginning with "//" incorrectly.
    Fortunately all we really need to do is split the path on "?".
    
    Closes #509.