[svn-commits] mnicholson: branch 1.6.2 r223173 - in /branches/1.6.2: ./ cdr/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Oct 9 12:27:55 CDT 2009
Author: mnicholson
Date: Fri Oct 9 12:27:48 2009
New Revision: 223173
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=223173
Log:
Merged revisions 223136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r223136 | mnicholson | 2009-10-09 12:14:38 -0500 (Fri, 09 Oct 2009) | 8 lines
Don't close the sqlite database when reloading. Only close the database when unloading.
(closes issue #15953)
Reported by: frawd
Patches:
sqlite3_rev220097.diff uploaded by frawd (license 610)
Tested by: frawd
........
Modified:
branches/1.6.2/ (props changed)
branches/1.6.2/cdr/cdr_sqlite3_custom.c
Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.2/cdr/cdr_sqlite3_custom.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/cdr/cdr_sqlite3_custom.c?view=diff&rev=223173&r1=223172&r2=223173
==============================================================================
--- branches/1.6.2/cdr/cdr_sqlite3_custom.c (original)
+++ branches/1.6.2/cdr/cdr_sqlite3_custom.c Fri Oct 9 12:27:48 2009
@@ -70,7 +70,7 @@
static AST_LIST_HEAD_STATIC(sql_values, values);
-static void free_config(void);
+static void free_config(int reload);
static int load_column_config(const char *tmp)
{
@@ -163,7 +163,7 @@
}
if (reload) {
- free_config();
+ free_config(1);
}
if (!(mappingvar = ast_variable_browse(cfg, "master"))) {
@@ -183,14 +183,14 @@
/* Columns */
if (load_column_config(ast_variable_retrieve(cfg, "master", "columns"))) {
ast_config_destroy(cfg);
- free_config();
+ free_config(0);
return -1;
}
/* Values */
if (load_values_config(ast_variable_retrieve(cfg, "master", "values"))) {
ast_config_destroy(cfg);
- free_config();
+ free_config(0);
return -1;
}
@@ -201,11 +201,11 @@
return 0;
}
-static void free_config(void)
+static void free_config(int reload)
{
struct values *value;
- if (db) {
+ if (!reload && db) {
sqlite3_close(db);
db = NULL;
}
@@ -279,7 +279,7 @@
{
ast_cdr_unregister(name);
- free_config();
+ free_config(0);
return 0;
}
@@ -300,7 +300,7 @@
res = sqlite3_open(filename, &db);
if (res != SQLITE_OK) {
ast_log(LOG_ERROR, "Could not open database %s.\n", filename);
- free_config();
+ free_config(0);
return AST_MODULE_LOAD_DECLINE;
}
@@ -316,7 +316,7 @@
if (res != SQLITE_OK) {
ast_log(LOG_WARNING, "Unable to create table '%s': %s.\n", table, error);
sqlite3_free(error);
- free_config();
+ free_config(0);
return AST_MODULE_LOAD_DECLINE;
}
}
@@ -324,7 +324,7 @@
res = ast_cdr_register(name, desc, sqlite3_log);
if (res) {
ast_log(LOG_ERROR, "Unable to register custom SQLite3 CDR handling\n");
- free_config();
+ free_config(0);
return AST_MODULE_LOAD_DECLINE;
}
More information about the svn-commits
mailing list