[sr-dev] git:master:e2ca5516: tmx: use branch index for $T_rpl() cache invalidation

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 13 09:03:59 CET 2018


Module: kamailio
Branch: master
Commit: e2ca5516ae086cf33c61dbb9e653a5484cca2074
URL: https://github.com/kamailio/kamailio/commit/e2ca5516ae086cf33c61dbb9e653a5484cca2074

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-11-13T08:59:43+01:00

tmx: use branch index for $T_rpl() cache invalidation

---

Modified: src/modules/tmx/t_var.c

---

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

---

diff --git a/src/modules/tmx/t_var.c b/src/modules/tmx/t_var.c
index 47e300af11..9fd28ee44b 100644
--- a/src/modules/tmx/t_var.c
+++ b/src/modules/tmx/t_var.c
@@ -34,6 +34,7 @@
 struct _pv_tmx_data {
 	unsigned int index;
 	unsigned int label;
+	int branch;
 	struct sip_msg msg;
 	struct sip_msg *tmsgp;
 	char *buf;
@@ -175,7 +176,8 @@ int pv_t_update_rpl(struct sip_msg *msg)
 	if(t->uac[branch].reply==NULL || t->uac[branch].reply==FAKED_REPLY)
 		return 1;
 
-	if (_pv_trpl.label == t->label && _pv_trpl.index == t->hash_index)  
+	if (_pv_trpl.label == t->label && _pv_trpl.index == t->hash_index
+			&& _pv_trpl.branch == branch)
 		return 0;
 
 	/* make a copy */
@@ -188,6 +190,7 @@ int pv_t_update_rpl(struct sip_msg *msg)
 		_pv_trpl.tmsgp = NULL;
 		_pv_trpl.index = 0;
 		_pv_trpl.label = 0;
+		_pv_trpl.branch = 0;
 		_pv_trpl.buf_size = t->uac[branch].reply->len+1;
 		_pv_trpl.buf = (char*)pkg_malloc(_pv_trpl.buf_size*sizeof(char));
 		if(_pv_trpl.buf==NULL)
@@ -207,6 +210,7 @@ int pv_t_update_rpl(struct sip_msg *msg)
 	_pv_trpl.tmsgp = t->uac[branch].reply;
 	_pv_trpl.index = t->hash_index;
 	_pv_trpl.label = t->label;
+	_pv_trpl.branch = branch;
 
 	if(pv_t_copy_msg(t->uac[branch].reply, &_pv_trpl.msg)!=0)
 	{
@@ -216,6 +220,7 @@ int pv_t_update_rpl(struct sip_msg *msg)
 		_pv_trpl.tmsgp = NULL;
 		_pv_trpl.index = 0;
 		_pv_trpl.label = 0;
+		_pv_trpl.branch = 0;
 		return -1;
 	}
 




More information about the sr-dev mailing list