#1096: keepalive semantics must correspond to _reported_ server HTTP protocol.
-----------------------------------+----------------------------------------
Reporter:
kris...@ccpgames.com | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone: 3.2
Component: wsgiserver | Resolution:
Keywords: |
-----------------------------------+----------------------------------------
Comment (by fumanchu):
The version number reported in the first line of an HTTP message is not
the version of the message; instead, it is the version of HTTP for which
the sender is at least conditionally compliant. Therefore, a CherryPy
server will always report itself as 1.1 even if the client reports itself
as 1.0 (unless you explicitly downgrade the CherryPy server via
server.protocol).
The `response_protocol` starts at 1.0 and is only upgraded to 1.1 if both
the server is 1.1 and the client reports itself as 1.1. This is why the
code you references emits Keep-Alive if "Server and/or client are
HTTP/1.0" (see the comments). Therefore, if the client reports itself as
1.0 and the server replies with no "Connection: close" header (and I
assume no "Keep-Alive" header) then it will close the connection. If the
proxy passed the message through with the HTTP/1.0 version declaration,
then it is responsible to recognize that no header means "close the
connection". If it rewrote the message and reported ''itself'' as 1.1,
then either it is seeing a "Connection: close" header and mishandling it,
or the resource is being streamed to the client by the server. If this
problem persists, it would help to do a tcpdump of the entire
conversation, including both the client-to-proxy traffic and the proxy-to-
server traffic to isolate the fault.