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

SourceForge.net noreply at sourceforge.net
Sun Feb 14 10:25:31 CET 2010


Patches item #2951523, was opened at 2010-02-14 12:25
Message generated for change (Tracker Item Submitted) made by 
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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: coxx ()
Assigned to: Nobody/Anonymous (nobody)
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;



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

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