]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: http: do not close connections anymore after internal responses
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Jun 2020 15:36:36 +0000 (17:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Jun 2020 15:41:32 +0000 (17:41 +0200)
commit2c4dfaeff667b770802711051dd5c04a7f634af8
tree97026e5b1f97645785115a20496b5eab4d3b7cbc
parent32234e751320b60a3879f274d4a4753d7570e757
MINOR: http: do not close connections anymore after internal responses

Since we dropped support for legacy mode, it's not the stream which
deals with the connection but the mux, and there's no point in closing
the client connection after most internal status codes. For example if
the client gets a 401 or a 503 because a server doesn't respond, it
makes no sense forcing the connection to close after reporting this
status, because it's already done by the mux if the client asks for it
or is not compatible with keep-alive. This current state was inherited
from the early days but is still limiting the amount of client-side
connection reuse in a number of circumstances (typically server-side
errors). This change was planned for 2.1 but forgotten.

The status codes for which the connection is not closed anymore are those
that do not depend on the client side connection itself, which are all
except 400 and 408. This could be backported to 2.1 but not further, in
order to make sure legacy and HTX behave strictly similarly.
src/http.c