From 1a8636d0179904743a118d8938d2c459d9617111 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 25 Apr 2022 08:15:46 +0200 Subject: [PATCH] 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. --- src/sample.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sample.c b/src/sample.c index 21bbadd9a..f43a79ed3 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;