TT#155903 pv_headers: pv_headers: restore pvh_real_hdr_del_by_name()

upstream patch was wrong function was wrongly removed

Change-Id: I57bb16815a0bfefe1356100c7056c5fae4c9bef9
mr10.3
Victor Seva 4 years ago
parent 48ff199bc5
commit 1927c059cc

@ -36,6 +36,7 @@ upstream/presence-info-logs-instead-of-error-for-not-maching-.patch
# https://github.com/kamailio/kamailio/pull/979
# collides with our changes to pua_dialoginfo
sipwise/Revert-pua_dialoginfo-disable-publish-notifications-.patch
upstream/pv_headers-restore-pvh_real_hdr_del_by_name.patch
## upstream master
upstream/lcr-source-port-check-for-from_any_gw-and-from_gw.patch
upstream/lcr-remove-excessive-checks-for-the-src_port-accurac.patch

@ -0,0 +1,41 @@
From b42dfd30ba74562e3c7673b3de449760bb315d62 Mon Sep 17 00:00:00 2001
From: Victor Seva <linuxmaniac@torreviejawireless.org>
Date: Wed, 22 Dec 2021 11:19:19 +0100
Subject: [PATCH] pv_headers: restore pvh_real_hdr_del_by_name()
it was wrongly removed at 09981c41cb6685fa18f61b9e7d66339917c4f097
(cherry picked from commit d8f0e71a0497e0bb98be60452914df51c84b56d8)
---
src/modules/pv_headers/pvh_hdr.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/modules/pv_headers/pvh_hdr.c b/src/modules/pv_headers/pvh_hdr.c
index 31c09b4b5d..fbb471ccd5 100644
--- a/src/modules/pv_headers/pvh_hdr.c
+++ b/src/modules/pv_headers/pvh_hdr.c
@@ -131,6 +131,21 @@ int pvh_real_hdr_append(struct sip_msg *msg, str *hname, str *hvalue)
return 1;
}
+int pvh_real_hdr_del_by_name(struct sip_msg *msg, str *hname)
+{
+ hdr_field_t *hf = NULL;
+
+ for(hf = msg->headers; hf; hf = hf->next) {
+ if(hf->name.len == hname->len
+ && strncasecmp(hf->name.s, hname->s, hname->len) == 0) {
+ LM_DBG("remove header[%.*s]: %.*s\n", hf->name.len, hf->name.s,
+ hf->body.len, hf->body.s);
+ del_lump(msg, hf->name.s - msg->buf, hf->len, 0);
+ }
+ }
+ return 1;
+}
+
int pvh_real_hdr_remove_display(struct sip_msg *msg, str *hname)
{
hdr_field_t *hf = NULL;
--
2.30.2
Loading…
Cancel
Save