[sr-dev] git:master: modules_k/dialog: Clear dialog and dialog variable tables after

Timo Reimann timo.reimann at 1und1.de
Wed Aug 17 10:01:55 CEST 2011


Module: sip-router
Branch: master
Commit: 76fc55be0107da80997f9515bb940e837ff899de
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=76fc55be0107da80997f9515bb940e837ff899de

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Wed Aug 17 09:58:38 2011 +0200

modules_k/dialog: Clear dialog and dialog variable tables 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').

---

 modules_k/dialog/dlg_db_handler.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules_k/dialog/dlg_db_handler.c b/modules_k/dialog/dlg_db_handler.c
index 4c283d7..6f55dcf 100644
--- a/modules_k/dialog/dlg_db_handler.c
+++ b/modules_k/dialog/dlg_db_handler.c
@@ -436,6 +436,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;
@@ -546,6 +553,13 @@ static int load_dialog_vars_from_db(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 variable table\n");
+			goto error;
+		}
+	}
+
 end:
 	dialog_dbf.free_result(dialog_db_handle, res);
 	return 0;




More information about the sr-dev mailing list