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,