I've taken the AsyncWeb code and modified it to create a stateless SIP server, and I came across a possible bug. First off, the AsyncWeb code is really impressive -- I love the state machine and the performance gain from not reading a bunch of data and then reparsing it (much faster than the old BufferedReader.readLine followed by parsing the line approach). Great work Trustin and Trevor and "irvingd" from the code.
The possible bug I came across is in the HTTP header value reading. It looks like the code doesn't properly handle HTTP header values where multiple values are included in the same header and are delimited with a comma. I believe the HttpHeaderDecodingState READ_HEADER_VALUE state should read to either a CRLF or a comma instead of just CRLF. The comma would trigger another READ_HEADER_VALUE state. The comma delimiting is specified in RFC 2616 at the end of section 4.2 on page 22. I would supply a patch, but I handle this a little differently in my code because I haven't yet rewritten everything and still use some of my old header parsing code. Should I be entering a bug somewhere? Am I missing something in the code or RFC? I'd be more than happy to write a test for it as well -- a simple HTTP header value parsing test. SIP makes use of comma delimiters in HTTP header values (SIP headers are HTTP headers) more often than HTTP, which is probably why I came across it. Great work again. Get all the legal wrangling worked out for AsyncWeb. It's a great project -- I really haven't been this impressed with chunk of code in awhile! -Adam
