]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: check: Remove wake_srv_chk() function
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Mar 2026 16:43:26 +0000 (17:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Mar 2026 14:10:34 +0000 (15:10 +0100)
wake_srv_chk() function is now only used by srv_chk_io_cb(), the
health-checl I/O callback function. So let's remove it. The code of the
function was moved in srv_chk_io_cb().

include/haproxy/check.h
src/check.c

index 842d7f7dda71925930e22446de40ae14ca837607..5e34d6519fc47f798669a4a8c67fad0e96d2dc72 100644 (file)
@@ -83,7 +83,6 @@ void check_release_buf(struct check *check, struct buffer *bptr);
 const char *init_check(struct check *check, int type);
 void free_check(struct check *check);
 void check_purge(struct check *check);
-int wake_srv_chk(struct stconn *sc);
 
 int init_srv_check(struct server *srv);
 int init_srv_agent_check(struct server *srv);
index afcd27b3ef7e6e3e65ae5b9c5a18c16f0fabd21f..57dc74b7f1079bb61f254aa66c393fdf690b8a7d 100644 (file)
@@ -1045,13 +1045,12 @@ int httpchk_build_status_header(struct server *s, struct buffer *buf)
 /**************************************************************************/
 /***************** Health-checks based on connections *********************/
 /**************************************************************************/
-/* This function is used only for server health-checks. It handles connection
- * status updates including errors. If necessary, it wakes the check task up.
- * It returns 0 on normal cases, <0 if at least one close() has happened on the
- * connection (eg: reconnect). It relies on tcpcheck_main().
+/* This function handles connection status updates including errors. If
+ * necessary, it wakes the check task up.
  */
-int wake_srv_chk(struct stconn *sc)
+struct task *srv_chk_io_cb(struct task *t, void *ctx, unsigned int state)
 {
+       struct stconn *sc = ctx;
        struct connection *conn;
        struct check *check = __sc_check(sc);
        int ret = 0;
@@ -1098,15 +1097,6 @@ int wake_srv_chk(struct stconn *sc)
 
   end:
        TRACE_LEAVE(CHK_EV_HCHK_WAKE, check);
-       return ret;
-}
-
-/* This function checks if any I/O is wanted, and if so, attempts to do so */
-struct task *srv_chk_io_cb(struct task *t, void *ctx, unsigned int state)
-{
-       struct stconn *sc = ctx;
-
-       wake_srv_chk(sc);
        return t;
 }