rejectedsoftware/vibe.d — pull request #450 by gittywithexcitement (2013-12-27 03:54:07+00:00)
Title: Keep alive

Fix for https://github.com/rejectedsoftware/vibe.d/issues/448
The logic is:

1. connection=close takes priority.
1. If the server tells us timeout and max, we use that.
1. Otherwise we go with the HTTP 1.1 default of assuming the connection remains open. It's unclear (at least from my googling around) what the default timeout value should be, so I went with 1 minute.

Also I changed `if (m_client.m_timeout > 0 && max > 1)` because keepAliveLimit+=timeout is already a conservative value, as the client set keepAliveLimit to a moment in time before the request was transmitted. So without subtracting 2s, the client's notion of connection timeout will be before the server's notion of it.