Module: sip-router
Branch: master
Commit: a9529ef43640621ecced53c8fe9374f5b0c12fca
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a9529ef…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Sat Jun 27 14:50:40 2009 +0300
* modules/utils: xcap table used already in child_init function
* Optimization: moved use of xcap table from get_rules_doc function to
child_init function.
---
modules/utils/utils.c | 4 ++++
modules/utils/utils.h | 1 -
modules/utils/xcap_auth.c | 5 -----
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/utils/utils.c b/modules/utils/utils.c
index 34b70c4..fe99c3b 100644
--- a/modules/utils/utils.c
+++ b/modules/utils/utils.c
@@ -205,6 +205,10 @@ static int pres_db_open(void) {
LM_ERR("can't connect to database\n");
return -1;
}
+ if (pres_dbf.use_table(pres_dbh, &xcap_table) < 0) {
+ LM_ERR("in use_table: %.*s\n", xcap_table.len, xcap_table.s);
+ return -1;
+ }
return 0;
}
diff --git a/modules/utils/utils.h b/modules/utils/utils.h
index 96d0286..d8b5afd 100644
--- a/modules/utils/utils.h
+++ b/modules/utils/utils.h
@@ -29,7 +29,6 @@
#include "../../lib/srdb1/db.h"
extern int http_query_timeout;
-extern str xcap_table;
extern db1_con_t *pres_dbh;
extern db_func_t pres_dbf;
diff --git a/modules/utils/xcap_auth.c b/modules/utils/xcap_auth.c
index e1d56f3..1815b07 100644
--- a/modules/utils/xcap_auth.c
+++ b/modules/utils/xcap_auth.c
@@ -366,11 +366,6 @@ int get_rules_doc(str* user, str* domain, int type, str** rules_doc)
n_query_cols++;
result_cols[xcap_doc_col= n_result_cols++] = &tmp4;
-
- if (pres_dbf.use_table(pres_dbh, &xcap_table) < 0) {
- LM_ERR("in use_table-[table]= %.*s\n", xcap_table.len, xcap_table.s);
- return -1;
- }
if (pres_dbf.query(pres_dbh, query_cols, 0 , query_vals, result_cols,
n_query_cols, 1, 0, &result) < 0) {