From: Alan T. DeKok Date: Fri, 16 Dec 2022 14:33:25 +0000 (-0500) Subject: remove xlat_sync_required() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=287249d6a7cbd7010ee6d2422cd60fa531096814;p=thirdparty%2Ffreeradius-server.git remove xlat_sync_required() synchronous xlats now call unlang_interpret_synchronous(), and thus can deal with async xlats --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 4f8180d427c..c25fd829ddd 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -5531,9 +5531,7 @@ bool tmpl_async_required(tmpl_t const *vpt) #ifndef HAVE_REGEX case TMPL_TYPE_REGEX_XLAT: #endif - case TMPL_TYPE_XLAT: - return xlat_async_required(tmpl_xlat(vpt)); - + case TMPL_TYPE_XLAT: /* synchronous xlats use unlang_interpret_synchronous() */ default: return false; } diff --git a/src/lib/unlang/xlat.h b/src/lib/unlang/xlat.h index 1465ef04718..8f44322f9c5 100644 --- a/src/lib/unlang/xlat.h +++ b/src/lib/unlang/xlat.h @@ -384,9 +384,6 @@ int xlat_aeval_compiled_argv(TALLOC_CTX *ctx, char ***argv, request_t *request, int xlat_flatten_compiled_argv(TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head); -bool xlat_async_required(xlat_exp_head_t const *xlat); - - fr_slen_t xlat_tokenize_expression(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in, fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules); diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 75f8c23410d..acc815d70c3 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -1694,17 +1694,3 @@ void xlat_eval_free(void) done_init = false; } - -/** Return whether or not async is required for this xlat. - * - * If the xlat is needs_async, then it MAY yield - * If the xlat is not needs_async, then it will NOT yield - * - * If the xlat yields, then async is required. - */ -bool xlat_async_required(xlat_exp_head_t const *head) -{ - if (!head) return false; - - return head->flags.needs_async; -}