[sr-dev] git:master: xhttp_pi: proper handling for unknown db column types

Ovidiu Sas osas at voipembedded.com
Tue Sep 2 20:31:25 CEST 2014


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

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Tue Sep  2 14:30:52 2014 -0400

xhttp_pi: proper handling for unknown db column types

---

 modules/xhttp_pi/xhttp_pi_fnc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/xhttp_pi/xhttp_pi_fnc.c b/modules/xhttp_pi/xhttp_pi_fnc.c
index 4d7f0a4..a51e692 100644
--- a/modules/xhttp_pi/xhttp_pi_fnc.c
+++ b/modules/xhttp_pi/xhttp_pi_fnc.c
@@ -570,7 +570,7 @@ int ph_getDbTableCols(ph_db_url_t *ph_db_urls, ph_db_table_t *db_tables,
 			db_tables->cols = cols;
 			cols = &db_tables->cols[db_tables->cols_size];
 			memset(cols, 0, sizeof(ph_table_col_t));
-			cols->type=-1;
+			cols->type=DB1_UNKNOWN;
 			/* Populate the field */
 			field.s =
 				ph_xmlNodeGetNodeContentByName(node->children,
@@ -683,7 +683,7 @@ int ph_getDbTableCols(ph_db_url_t *ph_db_urls, ph_db_table_t *db_tables,
 				if(strncmp("DB1_DATETIME",val,12)==0)
 					cols->type=DB1_DATETIME;
 			}
-			if(cols->type==-1){
+			if(cols->type==DB1_UNKNOWN){
 				LM_ERR("unexpected type [%s] for %s %s %s\n",
 					val, table_node->name, node->name,
 					XHTTP_PI_XML_TYPE_NODE);




More information about the sr-dev mailing list