[OpenSER-Devel] pvap fixup to mod_fix.c?

Henning Westerholt henning.westerholt at 1und1.de
Mon Dec 17 15:04:27 UTC 2007


On Monday 17 December 2007, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
>  > indeed, moving that will do quite a lot of cleanup in modules, making
>  > easier to maintain in case of a change. I am for this migration.
>
> if one function has one pvar arg and another one has two, should there
> then be pvar1 fixup and pvar2 fixup in the library or just one that has
> a test for both param_no 1 and param_no 2?
>
> to me it would be cleaner if each argument would have its own fixup
> function.  now that henning is going to introduce a loop into arg
> processing, could there be a loop also for fixup processing?

Sure, this would be cleaner. But how do should this implemented? Perhaps like 
this:

static cmd_export_t cmds[] = {
{"acc_log_request", w_acc_log_request, 1, acc_fixup_1, acc_fixup_2, ..., 
acc_fixup_N, free_acc_fixup, REQUEST_ROUTE|FAILURE_ROUTE}, ...}

but this interface not really pretty. Usage of a struct for functions params 
and the belonging fixup functions would be possible, but this is even more 
complicated than the proposed char** array. 

Cheers,

Henning



More information about the Devel mailing list