Another developer was doing some client-side development, and noticed the extra byte at the end of a CANCEL message.<br><br>Kennard<br><br><div class="gmail_quote">On Thu, Nov 4, 2010 at 2:59 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Kennard,<br>
<br>
Thanks for the fix - it a very stupid bug...hard to imagine how 1 ended<br>
up instead of 0 :-/<br>
<br>
I applied your patch with the fix only - I try to sync the code with the<br>
1.6 branch to make the backporting easier.<br>
<br>
BTW, how you spotted it - some trailing chars in ACKs and CANCELs ?<br>
<br>
REgards,<br>
Bogdan<br>
<div><div></div><div class="h5"><br>
Kennard White wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; There appears to be a minor bug in t_msgbuilder.c in HEAD. The<br>
&gt; build_local() function is off-by-one when computing the length of the<br>
&gt; message it is going to build. End result is that locally generated<br>
&gt; messages (CANCEL and some ACKs) have an extra garbage byte at end of<br>
&gt; message. The garbage byte happens to be a null. Other SIP stacks<br>
&gt; complain about this extra byte.<br>
&gt;<br>
&gt; The problem is this:<br>
&gt;            (Trans-&gt;extra_hdrs.s?Trans-&gt;extra_hdrs.len:1)<br>
&gt; The &quot;1&quot; should be a &quot;0&quot; to be consistent with the later code.<br>
&gt;<br>
&gt; I&#39;ve included patch that fixed this and changes the length computation<br>
&gt; to match the order in which the message it built. It also breaks up<br>
&gt; the length computation into groups. Goal is to make it easier to find<br>
&gt; future length computation errors -- took 4 hours to find this<br>
&gt; relatively simple error. I also added a final assert -- not sure what<br>
&gt; the opensips policy is on asserts.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Kennard<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Devel mailing list<br>
&gt; <a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
&gt;<br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Bootcamp<br>
15 - 19 November 2010, Edison, New Jersey, USA<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
</blockquote></div><br>