[PATCH 11 of 12] hgweb: use chunked encoding in responses
Mads Kiilerich
mads at kiilerich.com
Sun Jan 13 16:59:10 CST 2013
Maxim Dounin wrote, On 01/12/2013 08:19 PM:
> Please note that:
>
> 1) "Transfer-Encoding: chunked" isn't allowed when talking to
> HTTP/1.0 clients. Quote from RFC 2616,
> http://tools.ietf.org/html/rfc2616#section-3.6:
>
> ... A server MUST NOT send transfer-codings to an HTTP/1.0
> client.
>
> 2) It's probably bad idea to use "Transfer-Encoding" while working
> via CGI and derived protocols like FastCGI. Quote from RFC 3875,
> http://tools.ietf.org/html/rfc3875#section-6.3.4:
>
> The script MUST NOT return any header fields that relate to
> client-side communication issues and could affect the server's
> ability to send the response to the client.
>
> Overall, I don't think you should try to put "Transfer-Encoding:
> chunked" logic into hgweb. It should be server's job to do the
> right thing and keep the connection alive if possible.
>
Thanks, you are right.
For some reason I assumed hgweb was HTTP 1.1. only ... and the last
couple of patches were too much of an experiment towards fixing the
multiple ssl fingerprints warnings and make it somebody else's problem.
The layering was wrong - also according to WSGI. I will do the chunked
encoding in 'hg serve' instead - that will work for our test suite, but
probably not for the rest of the world.
Do you know how common it is that "servers" apply chunked encoding and
keep the connection alive when "the backend server" use "lightweight
http" and doesn't care? Will nginx do it ... and with which WSGI setups?
/Mads
More information about the Mercurial-devel
mailing list