Module: sip-router
Branch: 3.1
Commit: 410be63cfcd6368079dcf23d3118ec986e227fac
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=410be63…
Author: Timo Reimann <timo.reimann(a)1und1.de>
Committer: Timo Reimann <timo.reimann(a)1und1.de>
Date: Sun Aug 21 22:54:11 2011 +0200
modules_k/dialog: Clear dialog table after loading dialogs from
database into memory if DB_MODE_SHUTDOWN is used.
- Closes Flyspray issue #126 ('3.x dialog module: dialogs stay in
database when in "shutdown only" mode').
(cherry picked from commit 76fc55be0107da80997f9515bb940e837ff899de)
Conflicts:
modules_k/dialog/dlg_db_handler.c
---
modules_k/dialog/dlg_db_handler.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/modules_k/dialog/dlg_db_handler.c b/modules_k/dialog/dlg_db_handler.c
index 86dd074..4ec4f68 100644
--- a/modules_k/dialog/dlg_db_handler.c
+++ b/modules_k/dialog/dlg_db_handler.c
@@ -403,6 +403,13 @@ static int load_dialog_info_from_db(int dlg_hash_size, int
fetch_num_rows)
}while (nr_rows>0);
+ if (dlg_db_mode==DB_MODE_SHUTDOWN) {
+ if (dialog_dbf.delete(dialog_db_handle, 0, 0, 0, 0) < 0) {
+ LM_ERR("failed to clear dialog table\n");
+ goto error;
+ }
+ }
+
end:
dialog_dbf.free_result(dialog_db_handle, res);
return 0;