From: Christopher Faulet Date: Mon, 23 Nov 2026 07:19:01 +0000 (+0100) Subject: CLEANUP: tcpcheck: Stop to export most of custom expect functions X-Git-Url: https://git.kaiwu.me/http/ngx_http_flv_module.html?a=commitdiff_plain;h=bd744d18517fb64b20d41a9f1b87eebf3b286973;p=haproxy.git CLEANUP: tcpcheck: Stop to export most of custom expect functions The custom expect functions, for instance tcpcheck_ldap_expect_bindrsp(), are only used by tcpcheck rules. No reason to export them. The only exception is the one parsing agent-check response because the parsing of this option is performed in check.c. Note also tcpcheck_spop_expect_agenthello() was removed during SPOE refactoring, so there is no function definition. --- diff --git a/include/haproxy/tcpcheck.h b/include/haproxy/tcpcheck.h index d4878f9f4..5439d1f79 100644 --- a/include/haproxy/tcpcheck.h +++ b/include/haproxy/tcpcheck.h @@ -56,12 +56,6 @@ int tcpcheck_add_http_rule(struct tcpcheck_rule *chk, struct tcpcheck_ruleset *r void free_tcpcheck_http_hdr(struct tcpcheck_http_hdr *hdr); -enum tcpcheck_eval_ret tcpcheck_mysql_expect_iniths(struct check *check, struct tcpcheck_rule *rule, int last_read); -enum tcpcheck_eval_ret tcpcheck_mysql_expect_ok(struct check *check, struct tcpcheck_rule *rule, int last_read); -enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth(struct check *check, struct tcpcheck_rule *rule, int last_read); -enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth_done(struct check *check, struct tcpcheck_rule *rule, int last_read); -enum tcpcheck_eval_ret tcpcheck_ldap_expect_bindrsp(struct check *check, struct tcpcheck_rule *rule, int last_read); -enum tcpcheck_eval_ret tcpcheck_spop_expect_agenthello(struct check *check, struct tcpcheck_rule *rule, int last_read); enum tcpcheck_eval_ret tcpcheck_agent_expect_reply(struct check *check, struct tcpcheck_rule *rule, int last_read); enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpcheck_rule *rule); enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_rule *rule); diff --git a/src/tcpcheck.c b/src/tcpcheck.c index d19b8d659..df495328c 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -651,7 +651,7 @@ static enum tcpcheck_eval_ret tcpcheck_mysql_expect_packet(struct check *check, * TCPCHK_EVAL_CONTINUE to evaluate the next rule or TCPCHK_EVAL_STOP if an * error occurred. */ -enum tcpcheck_eval_ret tcpcheck_mysql_expect_iniths(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_mysql_expect_iniths(struct check *check, struct tcpcheck_rule *rule, int last_read) { return tcpcheck_mysql_expect_packet(check, rule, 0, last_read); } @@ -661,7 +661,7 @@ enum tcpcheck_eval_ret tcpcheck_mysql_expect_iniths(struct check *check, struct * data, TCPCHK_EVAL_CONTINUE to evaluate the next rule or TCPCHK_EVAL_STOP if * an error occurred. */ -enum tcpcheck_eval_ret tcpcheck_mysql_expect_ok(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_mysql_expect_ok(struct check *check, struct tcpcheck_rule *rule, int last_read) { unsigned int hslen = 0; @@ -749,7 +749,7 @@ static int tcpcheck_mysql_store_var(struct check *check, struct ist name, int ty * TCPCHK_EVAL_WAIT to wait for more data, TCPCHK_EVAL_CONTINUE to evaluate * the next rule or TCPCHK_EVAL_STOP if an error occurred. */ -enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth(struct check *check, struct tcpcheck_rule *rule, int last_read) { enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE; enum healthcheck_status status = HCHK_STATUS_L7RSP; @@ -904,7 +904,7 @@ enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth(struct check *check, struct tc * the next rule or TCPCHK_EVAL_STOP if an error occurred or if the check * succeeded. */ -enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth_done(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth_done(struct check *check, struct tcpcheck_rule *rule, int last_read) { enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE; enum healthcheck_status status = HCHK_STATUS_L7RSP; @@ -1005,7 +1005,7 @@ enum tcpcheck_eval_ret tcpcheck_mysql_expect_auth_done(struct check *check, stru * TCPCHK_EVAL_CONTINUE to evaluate the next rule or TCPCHK_EVAL_STOP if an * error occurred. */ -enum tcpcheck_eval_ret tcpcheck_ldap_expect_bindrsp(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_ldap_expect_bindrsp(struct check *check, struct tcpcheck_rule *rule, int last_read) { enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE; enum healthcheck_status status; @@ -1131,7 +1131,7 @@ enum tcpcheck_eval_ret tcpcheck_ldap_expect_bindrsp(struct check *check, struct * TCPCHK_EVAL_CONTINUE to evaluate the next rule or TCPCHK_EVAL_STOP if an * error occurred. */ -enum tcpcheck_eval_ret tcpcheck_spop_expect_hello(struct check *check, struct tcpcheck_rule *rule, int last_read) +static enum tcpcheck_eval_ret tcpcheck_spop_expect_hello(struct check *check, struct tcpcheck_rule *rule, int last_read) { enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE; enum healthcheck_status status;