[OpenSIPS-Devel] [ opensips-Patches-2951523 ] different retcode for database errors in domain module

SourceForge.net noreply at sourceforge.net
Thu Mar 4 17:56:35 CET 2010


Patches item #2951523, was opened at 2010-02-14 11:25
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2951523&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: coxx ()
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: different retcode for database errors in domain module

Initial Comment:
The common pattern for checking if a domain is ours is 
    if (!is_uri_host_local()) {
        sl_send_reply("403", "Forbidden. Domain $od is not ours.");
        exit;
    };
In this case we can't distinguish whether the database is broken or the domain is invalid. In case of problems with DB it's preferable to send "500 Server Internal Error".
So, I changed some returns in domain.c like this
 if (domain_dbf.use_table(db_handle, &domain_table) < 0) {
        LM_ERR("Error while trying to use domain table\n");
        return -3;



----------------------------------------------------------------------

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-03-04 18:56

Message:
Hi,

thanks, patch applied on trunk and 1.6.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086412&aid=2951523&group_id=232389



More information about the Devel mailing list