[Box Backup-commit] COMMIT r3638 - box/trunk/lib/httpserver

subversion at boxbackup.org subversion at boxbackup.org
Sat Aug 29 09:47:09 BST 2015


Author: chris
Date: 2015-08-29 08:47:09 +0000 (Sat, 29 Aug 2015)
New Revision: 3638

Modified:
   box/trunk/lib/httpserver/HTTPServer.cpp
Log:
Disable HTTP keepalive for now because we don't support it properly

Modified: box/trunk/lib/httpserver/HTTPServer.cpp
===================================================================
--- box/trunk/lib/httpserver/HTTPServer.cpp	2015-08-29 08:46:57 UTC (rev 3637)
+++ box/trunk/lib/httpserver/HTTPServer.cpp	2015-08-29 08:47:09 UTC (rev 3638)
@@ -169,9 +169,18 @@
 		{
 			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);




More information about the Boxbackup-commit mailing list