[Freeswitch-users] Confused with event content lengths

João Mesquita jmesquita at gmail.com
Sun Jun 28 11:57:21 PDT 2009


If I am not mistaken, you are always safe reading the amount data expressed
on Content-Length since it is calculated based on the total message length
before it is sent out of FS.

>From a protocol point of view, it would indeed be much better to rely on
something such as Content-Length then \n\n termination string. As I get to
know more and more the core developers, I doubt they would rely on the
latter.

Hope it helps...

jmesquita

On Sun, Jun 28, 2009 at 3:49 PM, Nik Middleton <
nik.middleton at noblesolutions.co.uk> wrote:

>  Hi Guys,
>
>
>
> I’m trying to parse events in C++ for an outbound socket.  The docs are a
> little contradictory, so I wonder if someone could help me out.
>
>
>
> As I understand it and event is terminated with double LF’s (\n\n)  However
> if there is a Content-Length header the wiki very confusingly says
>
>
>
> ‘Content-Length is the length of the event beginning *AFTER* the very next
> LF only line ("\n") and *inclusive* the trailing LF/LF pair ("\n\n")’
>
>
>
> BUT the example says it’s after the \n\n in the header!! Which is it?
>
>
>
> In addition, it also looks like the event body is also terminated by a
> \n\n.  If this is the case, why do I care about content length value, can’t
> I simply read until I get the termination sequence?
>
>
>
> Regards,
>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090628/cb93a7dc/attachment-0002.html 


More information about the FreeSWITCH-users mailing list