[asterisk-dev] [Code Review] Automatically calculate the content-length value for sip messages.

Matthew Nicholson mnicholson at digium.com
Fri Jun 4 13:55:31 CDT 2010



> On 2010-06-04 13:45:52, Mark Michelson wrote:
> > Because of the way that finalize_content() is defined and used, I think it might be safer (and easier) to just put a single call to finalize_content() inside the __sip_xmit() function. That way, it happens at the last possible moment before sending the message and there is no potential for accidentally attempting to write more content to the message after we have finalized matters. I haven't explored this too much myself, but it just jumped out at me as a possible improvement.

I did consider this.  There may have been one spot where this might cause problems.  I'll reconsider it.


- Matthew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/693/#review2152
-----------------------------------------------------------


On 2010-06-04 12:53:46, Matthew Nicholson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/693/
> -----------------------------------------------------------
> 
> (Updated 2010-06-04 12:53:46)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch modifies chan_sip to build the body of a sip message separate from the rest of the message and then merge the body into the rest of the message all at once while automatically calculating the content-length.  It is intended to simplify the creation of sip messages and make the process less error prone.
> 
> 
> This addresses bug 17326.
>     https://issues.asterisk.org/view.php?id=17326
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_sip.c 267670 
>   /trunk/channels/sip/include/sip.h 267670 
> 
> Diff: https://reviewboard.asterisk.org/r/693/diff
> 
> 
> Testing
> -------
> 
> I ran a portion of the external test suite and monitored the sip messages that were generated using wireshark.  Everything looked correct.
> 
> 
> Thanks,
> 
> Matthew
> 
>




More information about the asterisk-dev mailing list