[MINOR] http: make it possible to pretend keep-alive when doing close
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Apr 2010 14:15:16 +0000 (16:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Apr 2010 14:26:34 +0000 (16:26 +0200)
commit8a8e1d99cb0ab10b32313147528d86b65985ab81
tree7cdb0818608aae874be896c4bf6497ed3f2e93c9
parentefa5f51f00317d2f8e765c07081019c2f2440e27
[MINOR] http: make it possible to pretend keep-alive when doing close

Some servers do not completely conform with RFC2616 requirements for
keep-alive when they receive a request with "Connection: close". More
specifically, they don't bother using chunked encoding, so the client
never knows whether the response is complete or not. One immediately
visible effect is that haproxy cannot maintain client connections alive.
The second issue is that truncated responses may be cached on clients
in case of network error or timeout.

Óscar Frías Barranco reported this issue on Tomcat 6.0.20, and
Patrik Nilsson with Jetty 6.1.21.

Cyril Bonté proposed this smart idea of pretending we run keep-alive
with the server and closing it at the last moment as is already done
with option forceclose. The advantage is that we only change one
emitted header but not the overall behaviour.

Since some servers such as nginx are able to close the connection
very quickly and save network packets when they're aware of the
close negociation in advance, we don't enable this behaviour by
default.

"option http-pretend-keepalive" will have to be used for that, in
conjunction with "option http-server-close".
doc/configuration.txt
include/types/proxy.h
src/cfgparse.c
src/proto_http.c