[sr-dev] git:master:19c69e80: htable: ht_dmq_replicate_action was always called on ht_rm_items even if dmq was not activated

frederic frederic.gaisnon at mmtt.fr
Tue Mar 9 10:32:18 CET 2021


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

Author: frederic <frederic.gaisnon at mmtt.fr>
Committer: frederic <frederic.gaisnon at mmtt.fr>
Date: 2021-02-16T11:10:11+01:00

htable: ht_dmq_replicate_action was always called on ht_rm_items even if dmq was not activated

---

Modified: src/modules/htable/htable.c

---

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

---

diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c
index d05cf5227d..1bb36657de 100644
--- a/src/modules/htable/htable.c
+++ b/src/modules/htable/htable.c
@@ -484,7 +484,7 @@ static int ht_rm_items(sip_msg_t* msg, str* hname, str* op, str *val,
 		case 2:
 			if(strncmp(op->s, "re", 2)==0) {
 				isval.s = *val;
-				if (ht_dmq_replicate_action(HT_DMQ_RM_CELL_RE, &ht->name, NULL,
+				if ((ht->dmqreplicate > 0) && ht_dmq_replicate_action(HT_DMQ_RM_CELL_RE, &ht->name, NULL,
 							AVP_VAL_STR, &isval, mkey)!=0) {
 					LM_ERR("dmq relication failed (op %d)\n", mkey);
 				}
@@ -494,7 +494,7 @@ static int ht_rm_items(sip_msg_t* msg, str* hname, str* op, str *val,
 				return 1;
 			} else if(strncmp(op->s, "sw", 2)==0) {
 				isval.s = *val;
-				if (ht_dmq_replicate_action(HT_DMQ_RM_CELL_SW, &ht->name, NULL,
+				if ((ht->dmqreplicate > 0) &&ht_dmq_replicate_action(HT_DMQ_RM_CELL_SW, &ht->name, NULL,
 							AVP_VAL_STR, &isval, mkey)!=0) {
 					LM_ERR("dmq relication failed (op %d)\n", mkey);
 				}




More information about the sr-dev mailing list