[Devel] Re: Destroying fixup'd structures (was: Memory woes)

Bastian Friedrich bastian.friedrich at collax.com
Wed Jan 31 17:14:10 CET 2007


Hi,

On Wednesday 31 January 2007 15:44, Daniel-Constantin Mierla wrote:
> most of the functions in openser config do not have same values in
> parameters all the time. The fixup is required to convert the string to
> something else, that will be evaluated at runtime. For example:
>
> xlog("this is r-ruri $ru");
>
> is fixed at startup, to a list of elements that contains references to
> text for 'his is r-ruri ' and reference to a function that returns r-uri
> for '$ru'.

thanks for your explanation. In fact I had never fully understood /what/ fixup 
structures may look like...

> If you want to call xlog() from another module, you have to give the
> list of elements as parameter, not the initial string.

Unfortunately, this is only possible if the types of parameters are known in 
advance; the way the moduleFunc function in the perl module is implemented, 
this is impossible, as it is meant to be an all-embracing solution for every 
type of function, with every type of fixup.

> Perhaps destroy_fixup function is a good solution, but will take a lot of
> time and we have no much till freezing.

I definitely understand your point. It's sad that this problem was detected so 
late.

> One solution by now is to disable calls to functions exported by
> modules.

Unfortunately, this seems to be the only sensible solution for now. Another 
one might be an internal cache of references to fixed parameters for each 
triple of (function, parameter1, parameter2) - but that cache is not a quick 
hack, either, and it remains open whether it will be sufficient, as it might 
grow too big.

Tell me if you want me to disable the (implicit as well as explicit) module 
function calling.

> I see no much benefit as long as they can be executed directly 
> in configuration file. Access and management (rewrite uri, dst uri,
> ...)  sip_msg structure plus ability to set/get AVPs would be most of
> what one would like to do in PERL applications.

I was contacted by a developer (not from the smallest company... :) who wants 
to use the body_replace function inside a perl script. The string to be 
replaced is dynamic in his context. All other functions inside the textops 
module are interesting, to say the least, and maybe even crucial in a lot of 
contexts.

Although I implemented a xl_sprintf to read pseudo variables (which is 
currently flawed, too - patch will be on it's way shortly), the intended way 
to write them would have been through the avpops module; this one uses fixup 
functions, too...

Definitely interesting functions to be called from perl could be in:
* avpops
* textops
* acc
* gflags

Regards,
   Bastian

-- 
Collax GmbH . Burkheimer Straße 3 . 79111 Freiburg . Germany
p: +49 (0) 761-45684-24
f: +49 (0) 761-45684-10        www.collax.com

+++Besuchen Sie uns auf der Cebit vom 15.3. bis 21.3 2007 in Hannover
+++Halle 5 Stand F63
\ Death is a nonmaskable interrupt.



More information about the Devel mailing list