via: 1cbb8f221b2e76ec66c72d7f09d7f6ae681764b8 (commit)
from: ee0a0b79c87e268b3b266001bcab898544fbe4aa (commit)
= COMMIT LOG ===========================================================
committer: Anthony Minessale
comments:
supress errors caused from -nosql as reported on the mailing list and not on JIRA like it should be http://jira.freeswitch.org
diff --git a/src/switch_console.c b/src/switch_console.c
index c5d601b..43a5b17 100644
--- a/src/switch_console.c
+++ b/src/switch_console.c
@@ -1765,6 +1765,11 @@ SWITCH_DECLARE(switch_status_t) switch_console_set_complete(const char *string)
char *mydata = NULL, *argv[11] = { 0 };
int argc, x;
switch_status_t status = SWITCH_STATUS_FALSE;
+ switch_core_flag_t cflags = switch_core_flags();
+
+ if (!(cflags & SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
if (string && (mydata = strdup(string))) {
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index 2a6f9e3..8841fcc 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -922,7 +922,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_db_thread(switch_thread_t *threa
sec = 0;
}
- if (++reg_sec == SQL_REG_TIMEOUT) {
+ if (switch_test_flag((&runtime), SCF_USE_SQL) && ++reg_sec == SQL_REG_TIMEOUT) {
switch_core_expire_registration(0);
reg_sec = 0;
}
@@ -1648,6 +1648,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_add_registration(const char *user, c
switch_cache_db_handle_t *dbh;
char *sql;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;
@@ -1691,6 +1695,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
switch_cache_db_handle_t *dbh;
char *sql;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;
@@ -1717,6 +1725,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force)
char *sql;
switch_time_t now;
+ if (!switch_test_flag((&runtime), SCF_USE_SQL)) {
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_core_db_handle(&dbh) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB!\n");
return SWITCH_STATUS_FALSE;
Summary of changes: src/switch_console.c | 5 +++++ src/switch_core_sqldb.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletions(-)
this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630
--
FreeSWITCH Source