W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] WebSocket opening handshake, when to bail out

From: Simon Pieters <simonp@opera.com>
Date: Fri, 23 Apr 2010 13:05:50 +0200
Message-ID: <op.vbl3r0vridj3kv@simon-pieterss-macbook.local>
The establish a WebSocket connection algorithm is very specific about when  
to bail out. This is annoying. It means we have to reimplement header  
parsing just for WebSockets, when we already have very well tested header  
parsing in place. We'd like to be able to bail out or wait for more data  
as we see fit for the opening handshake. It does not seem to be  
interop-sensitive whether one browser bails out a few bytes earlier than  
another browser for an invalid handshake. The difference is only  
observable in carefully crafted cases where the server sleeps half-way  
through the handshake.

For instance, the algorithm says to wait for an 0x0A byte and only then  
check the status code. We want to check the status code earlier,  
byte-for-byte.

For the fields, the algorithm says to do some processing while parsing  
each field, and then do further processing when they're all received. We'd  
like to wait with processing them until we have them all.

(This feedback makes the earlier feedback about moving processing of  
fields with empty name moot.)

-- 
Simon Pieters
Opera Software
Received on Friday, 23 April 2010 04:05:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC