Module: kamailio
Branch: 5.6
Commit: 8404ba8c869f5d1e44bdf0111d97f249f68d90b5
URL:
https://github.com/kamailio/kamailio/commit/8404ba8c869f5d1e44bdf0111d97f24…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-09-26T20:49:46+02:00
pv: use the function for header name parsing that does not require the colon termination
(cherry picked from commit 1fbdc35c3d29da048cb06bfe0268c503c5015c3c)
---
Modified: src/modules/pv/pv_core.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8404ba8c869f5d1e44bdf0111d97f24…
Patch:
https://github.com/kamailio/kamailio/commit/8404ba8c869f5d1e44bdf0111d97f24…
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 1410d80b43..2441b49324 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2139,7 +2139,7 @@ int pv_get_hdr(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
LM_ERR("invalid name\n");
return -1;
}
- parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
+ parse_hname2_str(&tv.rs, &thdr);
if(thdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
return pv_get_null(msg, param, res);
@@ -2188,7 +2188,7 @@ int pv_get_hdrc(struct sip_msg *msg, pv_param_t *param, pv_value_t
*res)
LM_ERR("invalid name\n");
return pv_get_sintval(msg, param, res, hcount);
}
- parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
+ parse_hname2_str(&tv.rs, &thdr);
if(thdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
return pv_get_sintval(msg, param, res, 0);
@@ -2256,7 +2256,7 @@ int pv_get_hfl(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
LM_ERR("invalid name\n");
return -1;
}
- parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
+ parse_hname2_str(&tv.rs, &thdr);
if(thdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
return pv_get_sintval(msg, param, res, 0);
@@ -2500,7 +2500,7 @@ int pv_get_hflc(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
LM_ERR("invalid name\n");
return pv_get_sintval(msg, param, res, 0);
}
- parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
+ parse_hname2_str(&tv.rs, &thdr);
if(thdr.type==HDR_ERROR_T) {
LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
return pv_get_sintval(msg, param, res, 0);