[sr-dev] git:5.4:447e25a0: pv_headers: fix removal of all values when using PV_IDX_ALL

Victor Seva linuxmaniac at torreviejawireless.org
Fri Jul 23 17:12:52 CEST 2021


Module: kamailio
Branch: 5.4
Commit: 447e25a0d1bf7eadb045a79bff7bfa50b0dca71c
URL: https://github.com/kamailio/kamailio/commit/447e25a0d1bf7eadb045a79bff7bfa50b0dca71c

Author: Victor Seva <vseva at sipwise.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2021-07-23T17:12:14+02:00

pv_headers: fix removal of all values when using PV_IDX_ALL

$(x_hdr(whatever)[*]) = "hello" was just removing the first value

(cherry picked from commit 9ad96c08e0deb759297b2d402295691d8dd657d5)

---

Modified: src/modules/pv_headers/pvh_xavp.c

---

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

---

diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index 7cba757456..96fdc292b0 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/src/modules/pv_headers/pvh_xavp.c
@@ -618,7 +618,7 @@ int pvh_set_header(
 
 	if(val == NULL || (val->flags & PV_VAL_NULL)) {
 		if(idxf == PV_IDX_ALL) {
-			cnt = xavi_rm_by_name(hname, 1, &xavi);
+			cnt = xavi_rm_by_name(hname, 1, &avi);
 			LM_DBG("removed %d values of %.*s=>%.*s, set $null\n", cnt,
 					xavi->name.len, xavi->name.s, hname->len, hname->s);
 			if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_NULL, 0, 0)
@@ -649,7 +649,7 @@ int pvh_set_header(
 				goto err;
 		} else if(idxf == PV_IDX_ALL) {
 			if(hname_cnt > 1) {
-				cnt = xavi_rm_by_name(hname, 1, &xavi);
+				cnt = xavi_rm_by_name(hname, 1, &avi);
 				LM_DBG("removed %d values of %.*s=>%.*s\n", cnt, xavi->name.len,
 						xavi->name.s, hname->len, hname->s);
 			}




More information about the sr-dev mailing list