CLEANUP: log: removing "log-balance" references
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 5 Mar 2025 10:33:06 +0000 (11:33 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:22:28 +0000 (16:22 +0100)
This is a complementary patch to 0e1f389fe9 ("DOC: config: removing
"log-balance" references"): we properly removed all log-balance
references in the doc but there remained some in the code, let's fix
that.

It could be backported in 2.9 with 0e1f389fe9

(cherry picked from commit ddf66132f4d77e00c52c977d8a9e5c829965e7c7)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 24160712d38f54fe4114379ecbe034bcb25ee976)
[ad: ctx adjustment]
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>

src/cfgparse-listen.c
src/log.c

index 04c311d..d3d38c6 100644 (file)
@@ -50,7 +50,7 @@ static const char *common_kw_list[] = {
        "use-server", "force-persist", "ignore-persist", "force-persist",
        "stick-table", "stick", "stats", "option", "default_backend",
        "http-reuse", "monitor", "transparent", "maxconn", "backlog",
-       "fullconn", "dispatch", "balance", "log-balance", "hash-type",
+       "fullconn", "dispatch", "balance", "hash-type",
        "hash-balance-factor", "unique-id-format", "unique-id-header",
        "log-format", "log-format-sd", "log-tag", "log", "source", "usesrc",
        "error-log-format",
index c6ac2c3..c19f6d0 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1264,7 +1264,7 @@ static int postcheck_log_backend(struct proxy *be)
        if (err_code & ERR_CODE)
                return err_code;
 
-       /* "log-balance hash" needs to compile its expression */
+       /* "balance log-hash" needs to compile its expression */
        if ((be->lbprm.algo & BE_LB_ALGO) == BE_LB_ALGO_LH) {
                struct sample_expr *expr;
                char *expr_str = NULL;
@@ -1289,7 +1289,7 @@ static int postcheck_log_backend(struct proxy *be)
                 */
                memprintf(&expr_str, "str(dummy),%s", be->lbprm.arg_str);
                if (!expr_str) {
-                       memprintf(&msg, "memory error during converter list argument parsing (from \"log-balance hash\")");
+                       memprintf(&msg, "memory error during converter list argument parsing (from \"balance log-hash\")");
                        err_code |= ERR_ALERT | ERR_FATAL;
                        goto end;
                }
@@ -1298,7 +1298,7 @@ static int postcheck_log_backend(struct proxy *be)
                                         be->conf.line,
                                         &err_str, NULL, NULL);
                if (!expr) {
-                       memprintf(&msg, "%s (from converter list argument in \"log-balance hash\")", err_str);
+                       memprintf(&msg, "%s (from converter list argument in \"balance log-hash\")", err_str);
                        ha_free(&err_str);
                        err_code |= ERR_ALERT | ERR_FATAL;
                        ha_free(&expr_str);
@@ -1313,7 +1313,7 @@ static int postcheck_log_backend(struct proxy *be)
                 * error to prevent unexpected results during runtime.
                 */
                if (sample_casts[smp_expr_output_type(expr)][SMP_T_BIN] == NULL) {
-                       memprintf(&msg, "invalid output type at the end of converter list for \"log-balance hash\" directive");
+                       memprintf(&msg, "invalid output type at the end of converter list for \"balance log-hash\" directive");
                        err_code |= ERR_ALERT | ERR_FATAL;
                        release_sample_expr(expr);
                        ha_free(&expr_str);
@@ -2557,7 +2557,6 @@ static char *lf_port(char *dst, const struct sockaddr *sockaddr, size_t size, st
        return ret;
 }
 
-
 /*
  * This function sends the syslog message using a printf format string. It
  * expects an LF-terminated message.
@@ -3055,7 +3054,7 @@ static inline void __do_send_log_backend(struct proxy *be, struct log_header hdr
        else if ((be->lbprm.algo & BE_LB_ALGO) == BE_LB_ALGO_LH) {
                struct sample result;
 
-               /* log-balance hash */
+               /* balance log-hash */
                memset(&result, 0, sizeof(result));
                result.data.type = SMP_T_STR;
                result.flags = SMP_F_CONST;