[Kamailio-Devel] SF.net SVN: openser:[4677] trunk/modules/uri_db/uridb_mod.c

Henning Westerholt henning.westerholt at 1und1.de
Tue Aug 12 11:02:45 CEST 2008


On Tue, August 12, 2008 10:50 am, Raúl Alexis Betancor Santana wrote:
>> well, the else case is run if you do not set the use_uri_table, which is
>> the default. Then it will check the version of the subscriber table, as
>> the default value for db_table is subscriber. So why do you think it
>> will
>> not work here? (The code is perhaps a little bit redundant, though.)
>
> The error is that if you set db_table from .cfg but not use_uri_table, it
> will fails, so there is only 2 ways of solve that, or explaining it on
> the docs or giving away and error if use_uri_db is no set and db_table
is > different from the "default" value.

Hi,

its explained in the documentation that you need to set the "correct"
table name, and its depends on the use_uri_table parameter. If you have
suggestions to further refine the code i'm really open for your patch. :-)
This module was written long time ago, so today it will perhaps
implemented a little bit different.

> Maybe we have to think a little about how db_checks are done, because what
> happens if someone is using a "different" subscriber table?

If somebody choose to use a different table then he should to take care of
the version and scheme in their setup.

>> Ok, what do you suggest for error handling in C then? I also do not like
>> gotos, but think they are better then code duplication for cleanups and
>> similar work. But i'll take a look.
>
> What error handling? .. a return -1 ? ... checking other modules I've
> found "abuses" of goto use, for example on alias_db module "goto
> err_server", 5 times on alookup.c, IMHO ONE if statement and ONE log
call > followed by ONE
> return -1 could not be called "error handling".
> From my point of view, error handling is when you must close open
> files/conections, or take a desition about what to do.

You're correct, in this case it make probably not much sense, and i
removed it already. And i also agree with your other points. I already did
a lot of cleanups in the core and modules. But with 70+ modules and
200KLOCs code it just takes time. If you have suggestions/ improvements to
share please send it to me or this list

> Maybe all this is because I hate spagetti code ..

Same for me.

Henning




More information about the Devel mailing list