Module: kamailio
Branch: master
Commit: 9dadfe9234d26d3b8b8ea0603b3f8fa13f96913c
URL:
https://github.com/kamailio/kamailio/commit/9dadfe9234d26d3b8b8ea0603b3f8fa…
Author: Ovidiu Sas <osas(a)voipembedded.com>
Committer: Ovidiu Sas <osas(a)voipembedded.com>
Date: 2017-07-13T18:23:43-04:00
htable: improve some error logs
---
Modified: src/modules/htable/ht_db.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9dadfe9234d26d3b8b8ea0603b3f8fa…
Patch:
https://github.com/kamailio/kamailio/commit/9dadfe9234d26d3b8b8ea0603b3f8fa…
---
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);