[sr-dev] git:master: modules_k/pua: Fixed some dialog output levels

Peter Dunkley peter.dunkley at crocodile-rcs.com
Thu Dec 8 23:08:43 CET 2011


Module: sip-router
Branch: master
Commit: 2780fa74515612a3698a73b81d76c8ddd8a39fe4
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2780fa74515612a3698a73b81d76c8ddd8a39fe4

Author: pd <peter.dunkley at crocodile-rcs.com>
Committer: pd <peter.dunkley at crocodile-rcs.com>
Date:   Thu Dec  8 21:55:35 2011 +0000

modules_k/pua: Fixed some dialog output levels

---

 modules_k/pua/pua_db.c |   15 +++++++++------
 modules_k/pua/pua_db.h |    2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules_k/pua/pua_db.c b/modules_k/pua/pua_db.c
index b753217..e81cf3f 100644
--- a/modules_k/pua/pua_db.c
+++ b/modules_k/pua/pua_db.c
@@ -739,14 +739,14 @@ int is_dialog_puadb(ua_pres_t *pres)
 	if (nr_rows == 0)
 	{
 		/* no match */ 
-		LM_ERR("No rows found.\n");
+		LM_DBG("No rows found.\n");
 		return(-1);
 	}
 
 	if (nr_rows != 1)
 	{
-		LM_ERR("Too many rows found (%d)\n", nr_rows);
-		return(-1);
+		LM_WARN("Too many rows found (%d)\n", nr_rows);
+		/* no need to return here - drop thro */
 	}
 
 	return(0);
@@ -1430,7 +1430,7 @@ void update_puadb(ua_pres_t* pres, time_t desired_expires,
 
 /******************************************************************************/
 
-void insert_puadb(ua_pres_t* pres)
+int insert_puadb(ua_pres_t* pres)
 
 {
 	db_key_t db_cols[20];
@@ -1440,7 +1440,7 @@ void insert_puadb(ua_pres_t* pres)
 	if (pres==NULL)
 	{
 		LM_ERR("called with NULL param\n");
-		return;
+		return(-1);
 	}
 
 	if (pres->pres_uri)
@@ -1599,13 +1599,16 @@ void insert_puadb(ua_pres_t* pres)
 	if(pua_db == NULL)
 	{
 		LM_ERR("null database connection\n");
-		return;
+		return(-1);
 	}
 
 	if(pua_dbf.insert(pua_db, db_cols, db_vals, n_cols) < 0)  
 	{
 		LM_ERR("DB insert failed\n");
+		return(-1);
 	}
+
+	return(0);
 }
 
 /******************************************************************************/
diff --git a/modules_k/pua/pua_db.h b/modules_k/pua/pua_db.h
index fb2793d..7466511 100644
--- a/modules_k/pua/pua_db.h
+++ b/modules_k/pua/pua_db.h
@@ -58,7 +58,7 @@ int update_version_puadb(ua_pres_t *pres, int version );
 int update_contact_puadb(ua_pres_t *pres, str *contact);
 void update_puadb(ua_pres_t* pres, time_t desired_expires, 
                        int expires, str* etag, str *contact);
-void insert_puadb(ua_pres_t* pres);
+int insert_puadb(ua_pres_t* pres);
 
 
 #endif




More information about the sr-dev mailing list