Subject: RE: [Sip] ABNF issue

From: "Rob Phillips" <[email-masked]>
Date: Wed, 11 Dec 2002 06:08:07 -0600

Christer Holmberg writes:

> IF the spec would "narrow" the ABNF rules by saying that the definition 
> of LWS is not valid in the beginning of a new line, OR if the spec 
> would define the CRLFCRLF token, we would not have this problem.

I guess the way I read

          generic-message  =  start-line
                              *message-header
                              CRLF
                              [ message-body ]

the spec essentially DOES define a defacto CRLF-CRLF token (if not in ABNF) by saying that:
1. All message headers end with CRLF, and
2. When another CRLF follows directly thereafter, that marks the end of the message headers and the beginning of the message body (if any).

So that in taking your example:

INVITE sip:[email-masked] SIP/2.0 <CRLF_1>
Call-ID: [email-masked] <CRLF_2>
<CRLF_3>
<SP_1>CSeq: 100 INVITE <CRLF_4>

the precedence rules for interpreting CRLF_2-CRLF_3-SP_1 have to be treated as 
	(CRLF_2-CRLF_3) SP_1	"end of headers" 
instead of 
	CRLF_2 (CRLF_3-SP_1)	"CRLF LWS"

- rob
_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: Christer Holmberg <[email-masked]>
Date: Wed, 11 Dec 2002 14:41:32 +0200

Hi Rob,

> 2. When another CRLF follows directly thereafter, that marks the end of the message headers and the beginning of the message body (if any).

This "directly after" is part of what confuses me. To me it still sounds like a separate token, ie not a single CRLF-CRLF token. Anyway, if I
am the onlyone who understands in a different way there is no idea to continue arguing about it. Also, if everybody also agree on what is said
below, ie that a SIP header always must start at the beginning of a new line, there are no conflicts.

>         CRLF_2 (CRLF_3-SP_1)    "CRLF LWS"

So, this means that is not possible to use line folding before the first token (the header name) of a header, since assuming that the "directly
after" rule really means a CRLF-CRLF token the parser will assume it has found the end of the SIP part (due to the CRLF_2-CRLF_3) token, and
<SP_1> and the CSeq header will be treated as part of the message-body.

In this case, I think it is important to note that a SIP header MUST start at the BEGINNING of a new line. I think is said in the SDP spec, for
the SDP parameters, but not in the SIP spec for the SIP headers, is it? Also, H.248 explicitly says when something must be at the beginning of
a new line, and when SP eg is allowed.

Maybe this is something that could be tested at SIPit, or at least added to the torture test document?

Regards,

Christer Holmberg
Ericsson Finland