MT#56097 dialog: deactivate print_list

Change-Id: Id3b5c73f016fa78cff1aa72dce6e1ce71619fb3b
(cherry picked from commit 7b8dafd0e3)
(cherry picked from commit ddd257deb1)
(cherry picked from commit 576f27d503)
mr9.5.7
Victor Seva 2 years ago
parent 35e2077040
commit b5a4d0861c

@ -41,6 +41,7 @@ upstream/utils-kamcmd-add-missing-USE_READLINE-define-for-pkg.patch
## upstream master
upstream/permissions-don-t-remove-old-data-at-the-end-of-the-.patch
upstream/permissions-trusted_cleanup_interval.patch
upstream/dialog-deactivate-print-variable-function-which-is-o.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-local_identity_dlg_var.patch

@ -8,10 +8,10 @@ previously $ulc(x=>aor) had only the user part even with use_domain set
1 file changed, 31 insertions(+), 8 deletions(-)
diff --git a/src/modules/usrloc/udomain.c b/src/modules/usrloc/udomain.c
index 4025cc5..d7b9e8a 100644
index 204ddfd..534583e 100644
--- a/src/modules/usrloc/udomain.c
+++ b/src/modules/usrloc/udomain.c
@@ -956,7 +956,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
@@ -905,7 +905,7 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
db_val_t query_vals[3];
int key_num = 2;
db1_res_t* res = NULL;
@ -20,7 +20,7 @@ index 4025cc5..d7b9e8a 100644
int i;
int n;
urecord_t r;
@@ -964,6 +964,9 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
@@ -913,6 +913,9 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
#define RUIDBUF_SIZE 128
char ruidbuf[RUIDBUF_SIZE];
str ruid;
@ -30,7 +30,7 @@ index 4025cc5..d7b9e8a 100644
if (ul_db_mode!=DB_ONLY) {
return 0;
@@ -1058,6 +1061,14 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
@@ -1007,6 +1010,14 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
continue;
}
user.len = strlen(user.s);
@ -45,7 +45,7 @@ index 4025cc5..d7b9e8a 100644
ci = dbrow2info(ROW_VALUES(row)+1, &contact, 0);
if (ci==0) {
@@ -1066,18 +1077,30 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
@@ -1015,18 +1026,30 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
continue;
}
@ -81,7 +81,7 @@ index 4025cc5..d7b9e8a 100644
goto error;
}
@@ -1096,11 +1119,11 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
@@ -1045,11 +1068,11 @@ int udomain_contact_expired_cb(db1_con_t* _c, udomain_t* _d)
ruid.len = c->ruid.len;
} else {
LM_ERR("ruid is too long %d for %.*s\n", c->ruid.len,

@ -0,0 +1,85 @@
From: Henning Westerholt <hw@gilawa.com>
Date: Wed, 16 Nov 2022 15:33:06 +0000
Subject: dialog: deactivate print variable function which is only used for
debugging
- deactivate print variable function which is only used for debugging
- this function is not good for performance and might also cause race
conditions
---
src/modules/dialog/dialog.c | 3 +++
src/modules/dialog/dlg_var.c | 12 +++++++++---
src/modules/dialog/dlg_var.h | 2 ++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c
index 243bb9b..9823877 100644
--- a/src/modules/dialog/dialog.c
+++ b/src/modules/dialog/dialog.c
@@ -140,6 +140,8 @@ stat_var *expired_dlgs = 0;
stat_var *failed_dlgs = 0;
stat_var *early_dlgs = 0;
+int debug_variables_list = 0;
+
struct tm_binds d_tmb;
struct rr_binds d_rrb;
pv_spec_t timeout_avp;
@@ -327,6 +329,7 @@ static param_export_t mod_params[]={
{ "h_id_start", PARAM_INT, &dlg_h_id_start },
{ "h_id_step", PARAM_INT, &dlg_h_id_step },
{ "keep_proxy_rr", INT_PARAM, &dlg_keep_proxy_rr },
+ { "debug_variables", PARAM_INT, &debug_variables_list },
{ 0,0,0 }
};
diff --git a/src/modules/dialog/dlg_var.c b/src/modules/dialog/dlg_var.c
index b2a373a..311b3c0 100644
--- a/src/modules/dialog/dlg_var.c
+++ b/src/modules/dialog/dlg_var.c
@@ -317,7 +317,9 @@ int set_dlg_variable(struct dlg_cell *dlg, str *key, str *val)
if ( dlg_db_mode==DB_MODE_REALTIME )
update_dialog_dbinfo(dlg);
- print_lists(dlg);
+ if(unlikely(debug_variables_list)) {
+ print_lists(dlg);
+ }
return 0;
@@ -366,7 +368,9 @@ int pv_get_dlg_variable(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
}
}
- print_lists(dlg);
+ if(unlikely(debug_variables_list)) {
+ print_lists(dlg);
+ }
/* unlock dialog */
if (dlg) {
@@ -440,7 +444,9 @@ int pv_set_dlg_variable(struct sip_msg* msg, pv_param_t *param, int op, pv_value
}
dlg_unlock(d_table, &(d_table->entries[dlg->h_entry]));
}
- print_lists(dlg);
+ if(unlikely(debug_variables_list)) {
+ print_lists(dlg);
+ }
dlg_release(dlg);
return 0;
diff --git a/src/modules/dialog/dlg_var.h b/src/modules/dialog/dlg_var.h
index f13fa45..dc7698d 100644
--- a/src/modules/dialog/dlg_var.h
+++ b/src/modules/dialog/dlg_var.h
@@ -83,6 +83,8 @@ extern stat_var *processed_dlgs; /*!< number of processed dialogs */
extern stat_var *expired_dlgs; /*!< number of expired dialogs */
extern stat_var *failed_dlgs; /*!< number of failed dialogs */
+extern int debug_variables_list;
+
int pv_get_dlg_ctx(sip_msg_t *msg, pv_param_t *param,
pv_value_t *res);
int pv_set_dlg_ctx(sip_msg_t *msg, pv_param_t *param,
Loading…
Cancel
Save