Browse code

pv: use the function for header name parsing that does not require the colon termination

(cherry picked from commit 1fbdc35c3d29da048cb06bfe0268c503c5015c3c)

Daniel-Constantin Mierla authored on 26/09/2022 18:37:31
Showing 1 changed files
... ...
@@ -2139,7 +2139,7 @@ int pv_get_hdr(sip_msg_t *msg,  pv_param_t *param, pv_value_t *res)
2139 2139
 			LM_ERR("invalid name\n");
2140 2140
 			return -1;
2141 2141
 		}
2142
-		parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
2142
+		parse_hname2_str(&tv.rs, &thdr);
2143 2143
 		if(thdr.type==HDR_ERROR_T) {
2144 2144
 			LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
2145 2145
 			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)
2188 2188
 			LM_ERR("invalid name\n");
2189 2189
 			return pv_get_sintval(msg, param, res, hcount);
2190 2190
 		}
2191
-		parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
2191
+		parse_hname2_str(&tv.rs, &thdr);
2192 2192
 		if(thdr.type==HDR_ERROR_T) {
2193 2193
 			LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
2194 2194
 			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)
2256 2256
 			LM_ERR("invalid name\n");
2257 2257
 			return -1;
2258 2258
 		}
2259
-		parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
2259
+		parse_hname2_str(&tv.rs, &thdr);
2260 2260
 		if(thdr.type==HDR_ERROR_T) {
2261 2261
 			LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
2262 2262
 			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)
2500 2500
 			LM_ERR("invalid name\n");
2501 2501
 			return pv_get_sintval(msg, param, res, 0);
2502 2502
 		}
2503
-		parse_hname2_short(tv.rs.s, tv.rs.s + tv.rs.len, &thdr);
2503
+		parse_hname2_str(&tv.rs, &thdr);
2504 2504
 		if(thdr.type==HDR_ERROR_T) {
2505 2505
 			LM_ERR("error parsing header name [%.*s]\n", tv.rs.len, tv.rs.s);
2506 2506
 			return pv_get_sintval(msg, param, res, 0);