]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: return correct error code for srv_parse_agent_check
authorDirkjan Bussink <d.bussink@gmail.com>
Fri, 18 Jun 2021 19:57:49 +0000 (19:57 +0000)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Jun 2021 06:55:39 +0000 (08:55 +0200)
In srv_parse_agent_check the error code is not returned in case
something goes wrong. The value 0 is always return.

Additionally, there's a small cleanup of unreachable returns that in
most checks are not present either and removed in two places they were
present. This makes the code consistent across the different checks.

src/check.c

index 9c885eaad48a674a22086e8f08eed642fbaba0ee..aef1a151d205aa8a82eb2846d68d174f878bbe44 100644 (file)
@@ -1897,7 +1897,7 @@ static int srv_parse_agent_check(char **args, int *cur_arg, struct proxy *curpx,
        srv->do_agent = 1;
 
   out:
-       return 0;
+       return err_code;
 
   error:
        deinit_srv_agent_check(srv);
@@ -2155,7 +2155,6 @@ static int srv_parse_check_rise(char **args, int *cur_arg, struct proxy *curpx,
        deinit_srv_agent_check(srv);
        err_code |= ERR_ALERT | ERR_FATAL;
        goto out;
-       return 0;
 }
 
 /* Parse the "fall" server keyword */
@@ -2182,7 +2181,6 @@ static int srv_parse_check_fall(char **args, int *cur_arg, struct proxy *curpx,
        deinit_srv_agent_check(srv);
        err_code |= ERR_ALERT | ERR_FATAL;
        goto out;
-       return 0;
 }
 
 /* Parse the "inter" server keyword */