Although this appears to be a bug, your suggested solution
breaks many things. We would have to add a lot of SWS to
many, many other productions. I think we fix it in just
the comment production (i.e. making comment:
comment = LPAREN *(ctext / quoted-pair / comment) SWS ')'
In every case where comment is allowed, it is followed by
a separator that will match trailing whitespace, or the CRLF
at the end of the header, which will also do it.
Note for example that the LPAREN needs to have the SWS, so that
you can parse:
Server: Virtual Phone ( comment one ) ( comment two ) 1.1
with:
Server = "Server" HCOLON server-val *(LWS server-val)
server-val = product / comment
comment = LPAREN *(ctext / quoted-pair / comment) RPAREN
We really tried to make the grammar clean to read. Having to have
comment be:
comment = SWS '(' SWS *(ctext / quoted-pair / comment) SWS ')'
is correct, but not very clean
Brian
> -----Original Message-----
> From: Nataraju A.B. [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 25, 2003 8:28 AM
> To: Chris McKinnon; Mailing List SIP
> Subject: Re: [Sip-implementors] Comments
>
>
> Good finding..
>
> ----- Original Message -----
> From: "Chris McKinnon" <[EMAIL PROTECTED]>
> To: "Mailing List SIP" <[EMAIL PROTECTED]>
> Sent: Monday, August 25, 2003 4:48 AM
> Subject: [Sip-implementors] Comments
>
>
> > Hi,
> >
> > I'm looking at the "Server" and "User-Agent" headers and I see a
> > conflict with the "comment" fields (in the BNF). Say you had:
> > "Server: Virtual Phone (Demo) v1.1". This should parse into 3
> > "server-val" fields (product comment product) with a single space of
> > "LWS" between each field. However, because "comment" allows "SWS"
> > before and after the "(" and ")" the space after "(Demo)" will get
> > included with the comment. The parser is trying to find "LWS
> > SWS(...)SWS LWS" which causes issues. Should comments allow "SWS"
> > before the first "(" and after the last ")"? Is this a
> know bug? Or
> > should "LWS" in the header actually be "COMMA"?
>
> > [ABN] I feeel its better to change the definitions of
> LPAREN and RPAREN to
>
> LPAREN = "(" ; left parenthesis
> RPAREN = ")" ; right parenthesis
>
> Probably we can apply teh similar chenge to following
> definitions also...
>
> STAR = SWS "*" SWS ; asterisk
> SLASH = SWS "/" SWS ; slash
> EQUAL = SWS "=" SWS ; equal
> LPAREN = SWS "(" SWS ; left parenthesis
> RPAREN = SWS ")" SWS ; right parenthesis
> RAQUOT = ">" SWS ; right angle quote
> LAQUOT = SWS "<"; left angle quote
> COMMA = SWS "," SWS ; comma
> SEMI = SWS ";" SWS ; semicolon
> COLON = SWS ":" SWS ; colon
> LDQUOT = SWS DQUOTE; open double quotation mark
> RDQUOT = DQUOTE SWS ; close double quotation mark
>
> Regards,
> Nataraju A.B.
>
> > Thanks,
> >
> > Chris McKinnon
> >
> > _______________________________________________
> > Sip-implementors mailing list
> > [EMAIL PROTECTED]
> > http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
>
> _______________________________________________
> Sip-implementors mailing list
> [EMAIL PROTECTED]
> http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors
>
_______________________________________________
Sip-implementors mailing list
[EMAIL PROTECTED]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors