]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: Don't set the check port during the update from a state file
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Feb 2021 09:17:15 +0000 (10:17 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Feb 2021 09:42:45 +0000 (10:42 +0100)
When the server state is loaded from a server-state file, there is no reason
to set an unconfigured check port with the server port. Because by default,
if the check port is not set, the server's one is used. Thus we can remove
this useless assignment. It is mandatory for next improvements.

src/server.c

index 99b7e91812848d9f19876a7eb432f85db5b0454e..04e00d54a7fcb52be788a2e5d567dc0bf8941a05 100644 (file)
@@ -2973,11 +2973,6 @@ static void srv_update_state(struct server *srv, int version, char **params)
                                        goto out;
                                }
 
-                               /* configure check.port accordingly */
-                               if ((srv->check.state & CHK_ST_CONFIGURED) &&
-                                   !(srv->flags & SRV_F_CHECKPORT))
-                                       srv->check.port = port;
-
                                /* Unset SRV_F_MAPPORTS for SRV records.
                                 * SRV_F_MAPPORTS is unfortunately set by parse_server()
                                 * because no ports are provided in the configuration file.