diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-08-29 08:47:09 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-08-29 08:47:09 +0000 |
commit | 3c4e88671d641bb32d95ef33baa3f70fa1815289 (patch) | |
tree | a9229744d5c4f78e7fdbe2e7c611fa867a03972d /lib | |
parent | 6277dcbf16ad8da7a6f6f27655f212ccd06c5ac1 (diff) |
Disable HTTP keepalive for now because we don't support it properly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/httpserver/HTTPServer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/httpserver/HTTPServer.cpp b/lib/httpserver/HTTPServer.cpp index 3358e874..a2daed99 100644 --- a/lib/httpserver/HTTPServer.cpp +++ b/lib/httpserver/HTTPServer.cpp @@ -169,9 +169,18 @@ void HTTPServer::Connection(std::auto_ptr<SocketStream> apConn) { SendInternalErrorResponse("unknown", response); } - - // Keep alive? - if(request.GetClientKeepAliveRequested()) + + // Keep alive? response.GetSize() works for CollectInBufferStream, but + // when we make HTTPResponse stream the response instead, we'll need to + // figure out whether we can get the response length from the IOStream + // to be streamed, or not. Also, we don't currently support chunked + // encoding, and http://tools.ietf.org/html/rfc7230#section-3.3.1 says + // that "If any transfer coding other than chunked is applied to a + // response payload body, the sender MUST either apply chunked as the + // final transfer coding or terminate the message by closing the + // connection. So for now, keepalive stays off. + if(false && request.GetClientKeepAliveRequested() && + response.GetSize() >= 0) { // Mark the response to the client as supporting keepalive response.SetKeepAlive(true); |