[sr-dev] git:3.2: dialog(k): When restoring dialog variables from database calculate and

Timo Reimann sr at foo-lounge.de
Sun Nov 6 02:25:52 CET 2011


Module: sip-router
Branch: 3.2
Commit: 9442bf0249cab256c6bc68a219b2c44aee17c916
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9442bf0249cab256c6bc68a219b2c44aee17c916

Author: Timo Reimann <sr at foo-lounge.de>
Committer: Timo Reimann <sr at foo-lounge.de>
Date:   Sun Nov  6 02:21:08 2011 +0100

dialog(k): When restoring dialog variables from database calculate and
set variable string length.

- Fixes Flyspray #172.
(cherry picked from commit ae76e2183c9966cfe44c0519de7d5a53be08041c)

---

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

diff --git a/modules_k/dialog/dlg_db_handler.c b/modules_k/dialog/dlg_db_handler.c
index a9b38ef..5e0a7a0 100644
--- a/modules_k/dialog/dlg_db_handler.c
+++ b/modules_k/dialog/dlg_db_handler.c
@@ -526,7 +526,9 @@ static int load_dialog_vars_from_db(int fetch_num_rows)
 				dlg = (d_table->entries)[VAL_INT(values)].first;
 				while (dlg) {
 					if (dlg->h_id == VAL_INT(values+1)) {
-						set_dlg_variable_unsafe(dlg, &VAL_STR(values+2), &VAL_STR(values+3));
+						str key = { VAL_STR(values+2).s, strlen(VAL_STRING(values+2)) };
+						str value = { VAL_STR(values+3).s, strlen(VAL_STRING(values+3)) };
+						set_dlg_variable_unsafe(dlg, &key, &value);
 						break;
 					}
 					dlg = dlg->next;




More information about the sr-dev mailing list