[OpenSER-Devel] returning 0 from function

Dan Pascu dan at ag-projects.com
Mon Mar 3 11:38:13 CET 2008


On Monday 03 March 2008, Juha Heinanen wrote:
> Dan Pascu writes:
>  > AFAIK, there are functions in tm that rely on this, including
>  > t_relay if I'm not mistaken. I'd say that until a list of the module
>  > functions that use this behavior is made so we can draw a
>  > conclusion, it's premature to assume this will be easy to change, or
>  > that is even possible to give up on the behavior without major code
>  > restructuring.
>
> in my openser.cfg i do call exit also after t_relay.  i think is it is
> very bad programming practice to relay certain functions to exit the
> script implicitly.  in my opinion, no module function should cause the
> script to exit.  it should be always the decision of script writer.

I do not debate here the good or bad programming practices of doing this, 
I only highlighted the fact that it may not be so easy to change this 
given how intricate interaction between the many involved entities.
Anyway, even if you are to take that decision, you will do it based on 
something the function has returned, so in the end a value to indicate 
this would be required, even if it's not 0.

-- 
Dan



More information about the Devel mailing list