Compile-time parsing of expansions

Arran Cudbard-Bell a.cudbardb at freeradius.org
Fri Mar 21 17:57:27 CET 2014


On 21 Mar 2014, at 15:57, Alan DeKok <aland at deployingradius.com> wrote:

>  We now have more compile-time syntax checks.  This means that the
> server will complain if you get something wrong, and refuse to start.
> Right now, it gets a run-time error when it parses the string.  That is
> rather hard to see when it's running as a daemon...
> 
> --------------------
> https://github.com/FreeRADIUS/freeradius-server/commit/e4daaf2ceb58cb988492e602e7c2d399dd007fdd
> 
> Check RHS of update sections in pass2, for xlat syntax
> so:
> 
> 	update reply {
> 		Filter-Id := "%{foo: bar}"
> 	}
> 
> Will now get:
> 
> ...Failed parsing expanded string %{foo: bar}
>                                    ^ Unknown module
> 
> ---
> 
>  MUCH nicer.  And only ~50 lines of code, too.
> 
>  The next set of changes cache the pre-compiled xlat structure.  This
> means that the run-time is slightly faster, as it doesn't have to
> re-parse the "%{foo: bar}" string for every single packet.

The main speed improvement will most likely be from not having to alloc
all the nodes required to represent complex xlat strings.

Not having to do 30 odd allocs for each SQL query string will definitely
be an improvement.

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/mailman/private/freeradius-devel/attachments/20140321/5df1a9aa/attachment.pgp>


More information about the Freeradius-Devel mailing list