[sr-dev] git:5.5:fdfb8c55: dialog: remove dialog variable debugging function, it might cause race conditions

Henning Westerholt hw at gilawa.com
Wed Nov 16 17:05:54 CET 2022


Module: kamailio
Branch: 5.5
Commit: fdfb8c5563bd327774802cb08b68b27faee2e840
URL: https://github.com/kamailio/kamailio/commit/fdfb8c5563bd327774802cb08b68b27faee2e840

Author: Henning Westerholt <hw at gilawa.com>
Committer: Henning Westerholt <hw at gilawa.com>
Date: 2022-11-16T16:05:42Z

dialog: remove dialog variable debugging function, it might cause race conditions

---

Modified: src/modules/dialog/dlg_var.c

---

Diff:  https://github.com/kamailio/kamailio/commit/fdfb8c5563bd327774802cb08b68b27faee2e840.diff
Patch: https://github.com/kamailio/kamailio/commit/fdfb8c5563bd327774802cb08b68b27faee2e840.patch

---

diff --git a/src/modules/dialog/dlg_var.c b/src/modules/dialog/dlg_var.c
index b2a373a5018..8fd261c4bf5 100644
--- a/src/modules/dialog/dlg_var.c
+++ b/src/modules/dialog/dlg_var.c
@@ -254,31 +254,6 @@ int pv_parse_dialog_var_name(pv_spec_p sp, str *in)
 	return 0;
 }
 
-/*! Internal debugging function: Prints the list of dialogs */
-void print_lists(struct dlg_cell *dlg) {
-	struct dlg_var *varlist;
-	varlist = _dlg_var_table;
-	LM_DBG("Internal var-list (%p):\n", varlist);
-	while (varlist) {
-		LM_DBG("%.*s=%.*s (flags %i)\n",
-			varlist->key.len, varlist->key.s,
-			varlist->value.len, varlist->value.s,
-			varlist->vflags);
-		varlist = varlist->next;
-	}
-	if (dlg) {
-		varlist = dlg->vars;
-		LM_DBG("Dialog var-list (%p):\n", varlist);
-		while (varlist) {
-			LM_DBG("%.*s=%.*s (flags %i)\n",
-				varlist->key.len, varlist->key.s,
-				varlist->value.len, varlist->value.s,
-				varlist->vflags);
-			varlist = varlist->next;
-		}
-	}
-}
-
 str * get_dlg_variable(struct dlg_cell *dlg, str *key)
 {
     str* var = NULL;
@@ -317,8 +292,6 @@ 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);
-
     return 0;
 
 done:
@@ -366,8 +339,6 @@ int pv_get_dlg_variable(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
 		}
 	}
 
-	print_lists(dlg);
-
 	/* unlock dialog */
 	if (dlg) {
 		dlg_unlock(d_table, &(d_table->entries[dlg->h_entry]));
@@ -440,8 +411,6 @@ 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);
-
 	dlg_release(dlg);
 	return 0;
 error:




More information about the sr-dev mailing list