<html><head></head><body class="ApplePlainTextBody" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>On 10 Apr 2013, at 11:43, Brian Candler <B.Candler@pobox.com> wrote:<br><br><blockquote type="cite">On Wed, Apr 10, 2013 at 10:00:07AM -0400, Alan DeKok wrote:<br><blockquote type="cite"><blockquote type="cite">It's just that %{exec:...} and %{redis:...} expect to get a single un-xlat'd<br>string, which they split on space, and then xlat the parts individually.<br></blockquote><br> Yes. That can be fixed with simple changes.<br><br> a) the module supplies an "escape" function which escapes spaces<br><br> b) the "split on spaces" code converts escaped characters to the<br>non-escaped version... but doesn't split on escaped spaces<br></blockquote><br>Like this suggestion? :-)<br>http://lists.freeradius.org/pipermail/freeradius-devel/2012-October/007207.html<br><br><blockquote type="cite"> i.e. the "files" module should parse the xlat expansion once, and save<br>the parsed result. It can then be interpreted dynamically multiple times.<br></blockquote><br>Makes sense - like regcomp. (And of course, "files" could also precompile<br>the RHS of regexp match operators)<br></blockquote><br>No. Not unless the regexp library supports compiled, parameterised expressions.<br>If the files parser doesn't currently support nested expansions within the expression,<br>it will once it calls the new tokenizer.<br><br>For things like SQL however, it should be possible to precompile the statements<br>and you may get a small performance gain doing that.<br><br>This would be one advantage of having an xlat specific tokenizer callback. <br>It also means that the code that parses attribute references can be moved out<br>of the tokenizer, it really doesn't belong there.<br><br>Mixing xlat functions and attributes makes the code harder to understand, <br>there should be one common xlat attribute-ref function (wrapped and registered <br>a bunch of times for the different lists), to retrieve attribute values.<br><br>Once nested VPs are done, then there should be a single xlat function to expand all<br>attribute references.<br><br>-Arran<br><br></body></html>