Browse code

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)

Victor Seva authored on 23/07/2021 13:56:11 • Victor Seva committed on 23/07/2021 15:12:14
Showing 1 changed files
... ...
@@ -618,7 +618,7 @@ int pvh_set_header(
618 618
 
619 619
 	if(val == NULL || (val->flags & PV_VAL_NULL)) {
620 620
 		if(idxf == PV_IDX_ALL) {
621
-			cnt = xavi_rm_by_name(hname, 1, &xavi);
621
+			cnt = xavi_rm_by_name(hname, 1, &avi);
622 622
 			LM_DBG("removed %d values of %.*s=>%.*s, set $null\n", cnt,
623 623
 					xavi->name.len, xavi->name.s, hname->len, hname->s);
624 624
 			if(pvh_set_xavi(msg, &xavi_name, hname, NULL, SR_XTYPE_NULL, 0, 0)
... ...
@@ -649,7 +649,7 @@ int pvh_set_header(
649 649
 				goto err;
650 650
 		} else if(idxf == PV_IDX_ALL) {
651 651
 			if(hname_cnt > 1) {
652
-				cnt = xavi_rm_by_name(hname, 1, &xavi);
652
+				cnt = xavi_rm_by_name(hname, 1, &avi);
653 653
 				LM_DBG("removed %d values of %.*s=>%.*s\n", cnt, xavi->name.len,
654 654
 						xavi->name.s, hname->len, hname->s);
655 655
 			}