MINOR: proxy: Only consider backend httpclose option for server connections

For server connections, both the frontend and backend were considered to
enable the httpclose option. However, it is ambiguous because on client side
only the frontend is considerd. In addition for 2 frontends, one with the
option enabled and not for the other, the HTTP connection mode may differ
while it is a backend setting.

Thus, now, for the server side, only the backend is considered. Of course,
if the option is set for a listener, the option will be enabled if the
listener is the backend's connection.
This commit is contained in:
Christopher Faulet 2023-02-20 17:30:06 +01:00
parent 85523a0212
commit d17dd848c4
2 changed files with 2 additions and 5 deletions

View File

@ -9700,10 +9700,8 @@ no option httpclose
httpclose".
If "option httpclose" is set, HAProxy will close the client or the server
connection, depending where the option is set. Only the frontend is
considered for client connections while the frontend and the backend are
considered for server ones. In this case the option is enabled if at least
one of the frontend or backend holding the connection has it enabled. If the
connection, depending where the option is set. The frontend is considered for
client connections while the backend is considered for server ones. If the
option is set on a listener, it is applied both on client and server
connections. It will check if a "Connection: close" header is already set in
each direction, and will add one if missing.

View File

@ -1230,7 +1230,6 @@ static void h1_set_srv_conn_mode(struct h1s *h1s, struct h1m *h1m)
else if (!(h1m->flags & H1_MF_CONN_KAL) &&
((fe_flags & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||
(be->options & PR_O_HTTP_MODE) == PR_O_HTTP_SCL ||
(fe_flags & PR_O_HTTP_MODE) == PR_O_HTTP_CLO ||
(be->options & PR_O_HTTP_MODE) == PR_O_HTTP_CLO)) {
/* no explicit keep-alive option httpclose/server-close => close */
h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;