]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5141 revert f8d769ae1ce86c814cca03cbc8dee659447d3a19 from FS-4289
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 5 Mar 2013 15:07:02 +0000 (09:07 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 5 Mar 2013 15:07:02 +0000 (09:07 -0600)
src/switch_core_db.c

index 2eee23bce3e561c5661720a032b411fffd4346d9..6cc8896fab291b4d76e127ad031b8150bbd3985f 100644 (file)
@@ -197,43 +197,14 @@ SWITCH_DECLARE(int) switch_core_db_load_extension(switch_core_db_t *db, const ch
 
 SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename)
 {
-       switch_core_db_t *db = NULL;
+       switch_core_db_t *db;
        char path[1024];
        int db_ret;
-       struct integrity_check_cb_arg cb_arg;
-       int i;
-
 
        db_pick_path(filename, path, sizeof(path));
-
-       for (i = 0; i < 2; i++) {
-               if ((db_ret = switch_core_db_open(path, &db)) != SQLITE_OK) {
-                       goto end;
-               }
-
-               memset(&cb_arg, 0, sizeof(cb_arg));
-               if ((db_ret = switch_core_db_exec(db, "PRAGMA integrity_check;", integrity_check_cb, &cb_arg, NULL) != SQLITE_OK)) {
-                       goto end;
-               }
-
-               if (cb_arg.ok && (1 == cb_arg.rows)) {
-                       break;
-               } else if (0 == i) {
-                       char *cpath = switch_mprintf("%s.%ld.cdb", path, (long) switch_epoch_time_now(NULL));
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLite integrity_check failed for [%s]. Deleting file and retrying\n", path);
-                       switch_core_db_close(db);
-                       rename(path, cpath);
-                       free(cpath);
-                       continue;
-
-               } else {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLite integrity_check failed second time for [%s]\n", path);
-                       switch_core_db_close(db);
-                       db = NULL;
-                       goto end;
-               }
+       if ((db_ret = switch_core_db_open(path, &db)) != SQLITE_OK) {
+               goto end;
        }
-
        if ((db_ret = switch_core_db_exec(db, "PRAGMA synchronous=OFF;", NULL, NULL, NULL) != SQLITE_OK)) {
                goto end;
        }