...
|
...
|
@@ -1582,9 +1582,8 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
|
1582
|
1582
|
len+=new_tag->len-to_tag.len;
|
1583
|
1583
|
else
|
1584
|
1584
|
len+=new_tag->len+TOTAG_TOKEN_LEN/*";tag="*/;
|
1585
|
|
- } else {
|
1586
|
|
- len += hdr->len;
|
1587
|
1585
|
}
|
|
1586
|
+ len += hdr->len;
|
1588
|
1587
|
break;
|
1589
|
1588
|
case HDR_VIA:
|
1590
|
1589
|
/* we always add CRLF to via*/
|
...
|
...
|
@@ -1652,7 +1651,7 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
|
1652
|
1651
|
memcpy( p, CRLF, CRLF_LEN );
|
1653
|
1652
|
p+=CRLF_LEN;
|
1654
|
1653
|
/* headers*/
|
1655
|
|
- for ( hdr=msg->headers ; hdr ; hdr=hdr->next )
|
|
1654
|
+ for ( hdr=msg->headers ; hdr ; hdr=hdr->next ) {
|
1656
|
1655
|
switch (hdr->type)
|
1657
|
1656
|
{
|
1658
|
1657
|
case HDR_VIA:
|
...
|
...
|
@@ -1729,7 +1728,8 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
|
1729
|
1728
|
case HDR_CALLID:
|
1730
|
1729
|
case HDR_CSEQ:
|
1731
|
1730
|
append_str(p, hdr->name.s, hdr->len);
|
1732
|
|
- } /* for switch */
|
|
1731
|
+ } /* end switch */
|
|
1732
|
+ } /* end for */
|
1733
|
1733
|
/* lumps */
|
1734
|
1734
|
for(lump=msg->reply_lump;lump;lump=lump->next)
|
1735
|
1735
|
if (lump->type==LUMP_RPL_HDR){
|
...
|
...
|
@@ -1770,6 +1770,9 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text ,str *new_tag,
|
1770
|
1770
|
p+=body->text.len;
|
1771
|
1771
|
}
|
1772
|
1772
|
|
|
1773
|
+ if (len!=p-buf)
|
|
1774
|
+ LOG(L_CRIT,"BUGGGG!!!! diff len=%d p-buf=%d\n",len,p-buf);
|
|
1775
|
+
|
1773
|
1776
|
*(p) = 0;
|
1774
|
1777
|
*returned_len = len;
|
1775
|
1778
|
/* in req2reply, received_buf is not introduced to lumps and
|