Subject: [SIP] whitespace in SIP & SDP

From: [email-masked]
Date: Thu, 17 Aug 2000 14:24:26 +0530 (IST)

I have a query on the use of whitespace in SIP & SDP grammars.

There are these rules in SDP (rfc 2327):
--------------------------------------------------------------
   origin-field =        "o=" username SPACE
                         sess-id SPACE sess-version SPACE
                         nettype SPACE addrtype SPACE
                         addr CRLF

   email-address =       email "(" email-safe ")" | ...
--------------------------------------------------------------
which leads one to believe that space is allowed _only_ if
explicitly specified in the grammar.

But then there is this example in the rfc:
        e=[email-masked] (Mark Handley)
where there's a space between email & "(".

Similarly, in the SIP grammar (2543bis), there are these rules:
--------------------------------------------------------------
    Request-Line = Method SP Request-URI SP SIP-Version CRLF
    From = ("From" | "f") ":" (name-addr | addr-spec) 
--------------------------------------------------------------
And yet, the torture tests have
    From   : "J Rosenberg \\\"" <sip:[email-masked]> ;

So, what is the right way to interpret the use of whitespace in the grammar?
Should a parser be lenient with whitespace or should it stick to the grammar?

Thanks.

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

---

From: [email-masked]
Date: Thu, 17 Aug 2000 18:51:00 +0530

I just re-read the previous thread about this - it did not exactly address
what I was referring to.

In the prev. thread, it was mentioned that:

<quote>
To: "Some string\[CR][LF]
continued

Only the CR is escaped. The LF begins another line and would need to be
indented.

On the other hand

To: "Some string\[CR]
continued"

is just a single line.
</quote>

So expanding the above case

To: "Some string\[CR]
                    continued"

should preserve LWS then ?

Also what about:

To: "Some string\[CR][LF]
                    continued"

do we ignore LWS or not in front while forming the string ?

Regds
Arjun

Gethin Liddell <[email-masked]> on 08/17/2000 06:05:33 PM

To:   archow, [email-masked] (Richard Verhoeven)
cc:   [email-masked]

Subject:  Re: [SIP] whitespace in SIP & SDP

On Thu, 17 Aug 2000, [email-masked] wrote:
> (On a related note: A few days ago, someone pointed out an interesting
case
> of one line having a string without an ending quote, but slashed at the
> end, the next line having an LWS and then some text and then the
> terminating quote. - in which case I guess we cannot ignore the LWS
> like we usually do for continuation lines". Just thought I'd re-mention
> this interesting "torture" test wrt all our continuation line parsing
> routines
> we have in our implementations:-) )

do you mean, for example something like:

Header: headerStuff ;param="This is a
   wrapped quoted string"

i dont think we can really expect implementations to maintain the
quantity of white space within the quoted parameter.

Section C.1 (page 118 of bis-01)

"SIP header field values can be folded onto multiple lines if the
continuation line begins with a space or horizontal tab. All linear
white space, including folding, has the same semantics as SP. A
recipient MAY replace any linear white space with a single SP before
interpreting the field value or forwarding the message downstream."

whether it is in a quoted string or not i think is irrelevant.  it
still MAY be interpreted as a single white space.

--
Gethin Liddell
Ubiquity Software Corporation

http://www.ubiquity.net
mailto:[email-masked]