Skip to content

Commit

Permalink
sip_msg: drop h_via2 header from sip_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jan 14, 2025
1 parent b8bb444 commit da7da69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
1 change: 0 additions & 1 deletion modules/tm/sip_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ struct sip_msg* sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len,
else if ( !new_msg->via2 )
{
LINK_SIBLING_HEADER(h_via1, new_hdr);
new_msg->h_via2 = new_hdr;
new_msg->via2 = via_body_cloner( new_msg->buf,
org_msg->buf, (struct via_body*)hdr->parsed, &p);
new_hdr->parsed = (void*)new_msg->via2;
Expand Down
19 changes: 6 additions & 13 deletions parser/msg_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,20 +589,13 @@ int parse_headers_aux(struct sip_msg* msg, hdr_flags_t flags, int next, int sip_
link_sibling_hdr(h_via1,hf);
msg->parsed_flag|=HDR_VIA_F;
LM_DBG("via found, flags=%llx\n", (unsigned long long)flags);
if (sip_well_known_parse) {
if (msg->via1==0) {
LM_DBG("this is the first via\n");
msg->h_via1=hf;
msg->via1=hf->parsed;
if (msg->via1->next){
msg->via2=msg->via1->next;
msg->parsed_flag|=HDR_VIA2_F;
}
}else if (msg->via2==0){
msg->h_via2=hf;
msg->via2=hf->parsed;
if (sip_well_known_parse && msg->via1==0) {
LM_DBG("this is the first via\n");
msg->h_via1=hf;
msg->via1=hf->parsed;
if (msg->via1->next){
msg->via2=msg->via1->next;
msg->parsed_flag|=HDR_VIA2_F;
LM_DBG("parse_headers: this is the second via\n");
}
}
break;
Expand Down
1 change: 0 additions & 1 deletion parser/msg_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ struct sip_msg {
* (WARNING: do not deallocate them twice!)*/

struct hdr_field* h_via1;
struct hdr_field* h_via2;
struct hdr_field* callid;
struct hdr_field* to;
struct hdr_field* cseq;
Expand Down

0 comments on commit da7da69

Please sign in to comment.