]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: Only consider backend httpclose option for server connections
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 20 Feb 2023 16:30:06 +0000 (17:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Feb 2023 10:44:55 +0000 (11:44 +0100)
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.

doc/configuration.txt
src/mux_h1.c

index 73620307cfc90e370545eda8befb4c890d6aa541..3b1e29a25cc5d58d35bf590b8bd88bff0f553326 100644 (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.
index 00538ca32160c62fdb345edb3004eff539067d57..adf4569f7d3d2138920996065b8c9c75821bfacc 100644 (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;