Module: kamailio
Branch: master
Commit: 3c9b1d30f5350973bb6063ca207a3f0145f73ec5
URL:
https://github.com/kamailio/kamailio/commit/3c9b1d30f5350973bb6063ca207a3f0…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Date: 2017-08-03T10:28:28+03:00
p_usrloc: eliminate unused code
---
Modified: src/modules/p_usrloc/ul_db_handle.c
Modified: src/modules/p_usrloc/ul_db_handle.h
---
Diff:
https://github.com/kamailio/kamailio/commit/3c9b1d30f5350973bb6063ca207a3f0…
Patch:
https://github.com/kamailio/kamailio/commit/3c9b1d30f5350973bb6063ca207a3f0…
---
diff --git a/src/modules/p_usrloc/ul_db_handle.c b/src/modules/p_usrloc/ul_db_handle.c
index cf0dabdfa7..d827450916 100644
--- a/src/modules/p_usrloc/ul_db_handle.c
+++ b/src/modules/p_usrloc/ul_db_handle.c
@@ -301,80 +301,6 @@ int load_location_number(db_func_t * dbf, db1_con_t* dbh, int
*loc_nr){
return 0;
}
-int load_handles(db_func_t * dbf, db1_con_t * dbh) {
- static char query[UL_DB_QUERY_LEN];
- db1_res_t * res;
- db_row_t * row;
- ul_db_handle_list_t * element;
- int i, id, query_len;
- str tmp;
-
- if(!dbf || !dbh){
- LM_ERR("NULL parameter passed \n");
- return -1;
- }
-
- query_len = 25 + id_col.len + reg_table.len;
-
- if(query_len > UL_DB_QUERY_LEN) {
- LM_ERR("weird: query larger than %i bytes.\n", UL_DB_QUERY_LEN);
- return -1;
- }
-
- memset(query, 0, UL_DB_QUERY_LEN);
-
- if (sprintf(query,
- "SELECT DISTINCT "
- "%.*s "
- "FROM "
- "%.*s",
- id_col.len, id_col.s,
- reg_table.len, reg_table.s) < 0) {
- LM_ERR("could not print query\n");
- return -1;
- }
- tmp.s = query;
- tmp.len = strlen(query);
-
- if (dbf->raw_query (dbh, &tmp, &res) < 0) {
- LM_ERR("in database query.\n");
- return -1;
- }
-
- if (RES_ROW_N (res) == 0) {
- dbf->free_result (dbh, res);
- LM_DBG ("no data found\n");
- return 1;
- }
-
- for (i = 0; i < RES_ROW_N (res); ++i) {
- row = RES_ROWS (res) + i;
-
- if((element = allocate_handle_list()) == NULL) {
- LM_ERR("couldnt allocate handle.\n");
- goto errout;
- }
-
- if (VAL_NULL (ROW_VALUES(row) + 0)) {
- LM_ERR("Weird: Empty ID-Field\n");
- goto errout;
- }
-
- id = VAL_INT (ROW_VALUES(row) + 0);
- if(load_data(dbf, dbh, element->handle, id) < 0){
- LM_ERR("couldn't load handle data.\n");
- goto errout;
- }
- element->next = db_handles;
- db_handles = element;
- }
- dbf->free_result (dbh, res);
- return 0;
-errout:
- dbf->free_result (dbh, res);
- return -1;
-}
-
int refresh_handles(db_func_t * dbf, db1_con_t * dbh) {
ul_db_handle_list_t * element;
int i;
diff --git a/src/modules/p_usrloc/ul_db_handle.h b/src/modules/p_usrloc/ul_db_handle.h
index b9b5ade276..9916dc56ac 100644
--- a/src/modules/p_usrloc/ul_db_handle.h
+++ b/src/modules/p_usrloc/ul_db_handle.h
@@ -71,7 +71,6 @@ void destroy_handles(void);
int refresh_handles(db_func_t * dbf, db1_con_t * dbh);
int load_location_number(db_func_t * dbf, db1_con_t * dbh, int*);
-int load_handles(db_func_t * dbf, db1_con_t * dbh);
ul_db_handle_t * get_handle(db_func_t * dbf, db1_con_t * dbh, str * first, str *
second);