]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add note about future improvements
authorAlan T. DeKok <aland@freeradius.org>
Wed, 19 Feb 2025 20:11:55 +0000 (15:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 19 Feb 2025 20:12:44 +0000 (15:12 -0500)
src/lib/unlang/xlat_expr.c

index f57979e2ebb3c089bed437e9599b1d5b706d8d67..7ef14b93a5a03da51fb50ac97b1f12979fd5545b 100644 (file)
@@ -2535,6 +2535,23 @@ static fr_slen_t tokenize_field(xlat_exp_head_t *head, xlat_exp_t **out, fr_sbuf
                        *out = node;
                        FR_SBUFF_SET_RETURN(in, &our_in);
                }
+
+               /*
+                *      @todo - check if the input is %{...}, AND the contents are not exactly tmpl_attr_allowed_chars.
+                *      If so, parse it here as a nested expression.  That way we avoid a bounce through:
+                *
+                *              tmpl_afrom_substr() ->
+                *              xalt_tokenize() ->
+                *              xlat_tokenize_input() ->
+                *              xlat_tokenize_expansion() ->
+                *              xlat_tokenize_expression()
+                *
+                *      Which is horribly inefficient.  It also means that we have xlats containing tmpls
+                *      which then contain xlats.
+                *
+                *      If the content is exactly tmpl_attr_allowed_chars, then we can parse it either as a
+                *      regex reference, OR as an attribute expansion.
+                */
                break;
 
        case T_SOLIDUS_QUOTED_STRING: