Subject: [SIP] RE: [Test Bed Technical Forum:] Determining the length of the SIP message body

From: "Jo Hornsby" <[email-masked]>
Date: Fri, 22 Sep 2000 15:09:38 +0100

This question is more appropriate on the SIP List; Cc:d.

>  MESSAGE:  (#45) Determining the length of the SIP message body 
>           
> <http://www.sipcentre.com/cgi-bin/webbbs/technical_config.pl?rev=45> 
>  AUTHOR:   Duke Snyder 
>  DATE:     Friday, 22 September 2000, at 1:54 p.m. 
>
> If there is a content-length header then no problem - but the 
> content-length header is optional (according to the rfc in
> section 6.17).

This is true -- Content-Length is indeed specified as optional
in the RFC; however, the bis02 draft, which trackes current
state of the art, makes it mandatory.

> If no content-length header, how do the servers determine if 
> there is a body: 
> 1. There is a body if there is a content-type header - is this true? 

Although it would be odd for there to be a Content-Type header
and no body, I don't see this technically illegal (especially
if Content-Length was specified as 0).  I wouldn't rely on
Content-Type to imply the presence or otherwise of a body.

> If no content-length header and there is a body, how do you determine
> its length? 
> 1. The body goes to the end of the udp packet - is this true?. 

Yes.

> 2. The body goes to the first CRLF after decoding - but the rfc does
> not mention a CRLF after the message body. 

No, since it is perfectly legal to have one or more CRLFs in a
body (think SDP).

> 3. The content-length field must be used if tcp - is this true? 

Yes, well, it's true pretty much universally true nowadays.
(There is some leniency towards Content-Length in responses;
this is to make stuff like SIP CGI easier, for instance.)

See Table 4 and Section 6.19 of bis02 (available from Henning's
site) for the definitive rules.

HTH,

 - Jo.

_______________________________________________
SIP mailing list
[email-masked]
http://lists.bell-labs.com/mailman/listinfo/sip

---

From: Jonathan Rosenberg <[email-masked]>
Date: Mon, 25 Sep 2000 10:25:29 -0400

> -----Original Message-----
> From: Jo Hornsby [mailto:[email-masked]]
> Sent: Friday, September 22, 2000 10:10 AM
> To: [email-masked]
> Cc: [email-masked]
> Subject: [SIP] RE: [Test Bed Technical Forum:] Determining 
> the length of
> the SIP message body
> 
> 

RFC2543 does not mandate it for tcp. Without one, the body continues until
the connection is closed.

-Jonathan R.
---
Jonathan D. Rosenberg                       72 Eagle Rock Ave.
Chief Scientist                             First Floor
dynamicsoft                                 East Hanover, NJ 07936
[email-masked]                     FAX:   (973) 952-5050
http://www.cs.columbia.edu/~jdrosen         PHONE: (973) 952-5000
http://www.dynamicsoft.com