Module: kamailio
Branch: 5.0
Commit: e7ebdcfee72d0d54c375383565fd1fcd3816c7c1
URL:
https://github.com/kamailio/kamailio/commit/e7ebdcfee72d0d54c375383565fd1fc…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: 2017-07-13T18:27:00-04:00
htable: improve some error logs
(cherry picked from commit 9dadfe9234d26d3b8b8ea0603b3f8fa13f96913c)
---
Modified: src/modules/htable/ht_db.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e7ebdcfee72d0d54c375383565fd1fc…
Patch:
https://github.com/kamailio/kamailio/commit/e7ebdcfee72d0d54c375383565fd1fc…
---
diff --git a/src/modules/htable/ht_db.c b/src/modules/htable/ht_db.c
index fd5ec46c0e..5cdecb1814 100644
--- a/src/modules/htable/ht_db.c
+++ b/src/modules/htable/ht_db.c
@@ -276,7 +276,8 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
for(i=0; i<RES_ROW_N(db_res); i++)
{
if(VAL_NULL(&RES_ROWS(db_res)[i].values[0])) {
- LM_ERR("key value must not be null\n");
+ LM_ERR("htable [%.*s] row [%d] has NULL key value\n",
+ ht->name.len, ht->name.s, i);
goto error;
}
@@ -284,7 +285,8 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
case DB1_STR:
kname.s = (RES_ROWS(db_res)[i].values[0].val.str_val.s);
if(kname.s==NULL) {
- LM_ERR("null key in row %d\n", i);
+ LM_ERR("htable [%.*s] row [%d] has NULL key\n",
+ ht->name.len, ht->name.s, i);
goto error;
}
kname.len = (RES_ROWS(db_res)[i].values[0].val.str_val.len);
@@ -292,7 +294,8 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
case DB1_BLOB:
kname.s = (RES_ROWS(db_res)[i].values[0].val.blob_val.s);
if(kname.s==NULL) {
- LM_ERR("null key in row %d\n", i);
+ LM_ERR("htable [%.*s] row [%d] has NULL key\n",
+ ht->name.len, ht->name.s, i);
goto error;
}
kname.len = (RES_ROWS(db_res)[i].values[0].val.blob_val.len);
@@ -300,7 +303,8 @@ int ht_db_load_table(ht_t *ht, str *dbtable, int mode)
case DB1_STRING:
kname.s = (char*)(RES_ROWS(db_res)[i].values[0].val.string_val);
if(kname.s==NULL) {
- LM_ERR("null key in row %d\n", i);
+ LM_ERR("htable [%.*s] row [%d] has NULL key\n",
+ ht->name.len, ht->name.s, i);
goto error;
}
kname.len = strlen(kname.s);