From: Willy Tarreau Date: Mon, 25 Apr 2022 06:15:46 +0000 (+0200) Subject: BUG/MINOR: sample: add missing use_backend/use-server contexts in smp_resolve_args X-Git-Tag: v2.6-dev8~86 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a8636d0179904743a118d8938d2c459d9617111;p=thirdparty%2Fhaproxy.git BUG/MINOR: sample: add missing use_backend/use-server contexts in smp_resolve_args The use_backend and use-server contexts were not enumerated in smp_resolve_args, and while use-server doesn't currently take an expression, at least use_backend supports that, and both entries ought to be listed for completeness. Now an error in a use_backend rule becomes more precise, from: [ALERT] (12373) : config : parsing [use-srv.cfg:33]: unable to find backend 'foo' referenced in arg 1 of sample fetch keyword 'nbsrv' in proxy 'echo'. to: [ALERT] (12307) : config : parsing [use-srv.cfg:33]: unable to find backend 'foo' referenced in arg 1 of sample fetch keyword 'nbsrv' in use_backend expression in proxy 'echo'. This may be backported though this is totally harmless. --- diff --git a/src/sample.c b/src/sample.c index 21bbadd9a0..f43a79ed31 100644 --- a/src/sample.c +++ b/src/sample.c @@ -1295,6 +1295,8 @@ int smp_resolve_args(struct proxy *p, char **err) case ARGC_ACL: ctx = "ACL keyword"; break; case ARGC_SRV: where = "in server directive in"; break; case ARGC_SPOE: where = "in spoe-message directive in"; break; + case ARGC_UBK: where = "in use_backend expression in"; break; + case ARGC_USRV: where = "in use-server expression in"; break; case ARGC_HERR: where = "in http-error directive in"; break; case ARGC_OT: where = "in ot-scope directive in"; break; case ARGC_TCO: where = "in tcp-request connection expression in"; break;