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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

SourceForge.net
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

_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel