瀏覽代碼

Tests for return value of db.use_table functions added

Jan Janak 21 年之前
父節點
當前提交
545d2acce5
共有 3 個文件被更改,包括 9 次插入6 次删除
  1. 5 1
      db/db_fifo.c
  2. 3 4
      test/register.sip
  3. 1 1
      usr_avp.c

+ 5 - 1
db/db_fifo.c

@@ -708,7 +708,11 @@ int db_fifo( FILE *fifo, char *response_file )
 
 	/* select the correct table */
 	line.s[line.len] = 0; /* make it null terminated */
-	fifo_dbf.use_table( fifo_db_con, line.s);
+
+	if (fifo_dbf.use_table( fifo_db_con, line.s) < 0) {
+		double_log("use_table function failed");
+		goto error1;
+	}
 
 	/*read 'where' avps */
 	if (get_avps( fifo , keys2, ops2, vals2, &nr2, MAX_ARRAY)!=0 )

+ 3 - 4
test/register.sip

@@ -1,12 +1,11 @@
-REGISTER sip:dhcp246.fokus.gmd.de:5060 SIP/2.0
+REGISTER sip:voip.net:5060 SIP/2.0
 From: "Jan Janak" <sip:[email protected]>
 To: "Jan_Janak" <sip:[email protected]>
 Call-ID: [email protected]
 User-Agent: snom100_1.9b
 CSeq: 2 REGISTER
-Via: SIP/2.0/UDP 195.37.78.208:5060
-Expires: 0
-Contact: <sip:[email protected]>;expires=2
+Via: SIP/2.0/UDP 195.37.78.177:5060
+Contact: <sip:[email protected]>
 Content-Length: 0
 
 

+ 1 - 1
usr_avp.c

@@ -70,7 +70,7 @@ int init_avp_child( int rank )
 			LOG(L_ERR,"ERROR:init_avp_child: unable to connect to database\n");
 			return -1;
 		}
-		if (avp_dbf.use_table( avp_db_con, AVP_DB_TABLE )<0) {
+		if (avp_dbf.use_table( avp_db_con, AVP_DB_TABLE ) < 0) {
 			/* table selection failed */
 			LOG(L_ERR,"ERROR:init_avp_child: unable to select db table\n");
 			return -1;