playframework/playframework — pull request #1959 by jroper (2013-10-31 03:39:40+00:00)
Title: Play should not close all async result connections

Play was closing all connections if it was an async result. It was also
closing connections in a number of other places that it shouldn't, such as
when an async action threw an exception and when a handler could not be
found.

This fixes the problem, by ensuring the `closeConnection` flag is propogated
when async results are recursively unwrapped.

It also fixes #1958, when we do close HTTP 1.1 connections, we need to set a
`Connection: close` header, otherwise the client might reuse the connection
before it finds out the connection is closed.