Bug 45215

Summary: WebSocket Handshake problem
Product: WebKit Reporter: Everton <everton.sales.branco>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, ukai
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   

Description Everton 2010-09-03 16:55:50 PDT
I'm developing an HTTP server, with funds from websocket.
I'm having some problems with websocket Handshake and think it's a problem with websocket, as it happens with Chrome 7.0.513.0 Canary build and Safari 5.0.1 (7533.17.8), and everything works correctly in Firefox4.0b4

What happens is that the 10 connection attempt, only two or three can be successful.
see this connection in case of failure:

-------------------- Canary build Chrome 7.0.513.0 or Safari 5.0.1 -> server

GET / HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: 192.168.3.3:19009
Origin: http://server01.alameda.cco:19009
Sec-WebSocket-Key1: 8 1 530 in 2365, R
Sec-WebSocket-Key2: 308 9 5 112 Z22

#194 #223 #162 #101 #23 #25 #86 #216 <- translated to ascii decimals codes


-------------------- Server -> canary build Chrome 7.0.513.0 or Safari 5.0.1 

HTTP/1.1 101 WebSocket Handshake Protocol
Connection: Upgrade
Upgrade: WebSocket
Sec-Websocket-Origin: http://server01.alameda.cco:19009
Sec-Websocket-Location: ws://192.168.3.3:19009/

#230 #171 #238 #85 #73 #252 #52 #120 #110 #142 #248 #64 #235 #48 #115 #180 <- translated to ascii decimals codes
Comment 1 Fumitoshi Ukai 2010-09-07 00:06:21 PDT
As I said in http://crbug.com/54321,
it seems sec-websocket-key2 has wrong number of space, because 3089511222/4 = 772377805.5. I'm afraid it should have 6 spaces, and your capture normalize LWSP as one space in http header.


(In reply to comment #0)
> I'm developing an HTTP server, with funds from websocket.
> I'm having some problems with websocket Handshake and think it's a problem with websocket, as it happens with Chrome 7.0.513.0 Canary build and Safari 5.0.1 (7533.17.8), and everything works correctly in Firefox4.0b4
> 
> What happens is that the 10 connection attempt, only two or three can be successful.
> see this connection in case of failure:
> 
> -------------------- Canary build Chrome 7.0.513.0 or Safari 5.0.1 -> server
> 
> GET / HTTP/1.1
> Upgrade: WebSocket
> Connection: Upgrade
> Host: 192.168.3.3:19009
> Origin: http://server01.alameda.cco:19009
> Sec-WebSocket-Key1: 8 1 530 in 2365, R
> Sec-WebSocket-Key2: 308 9 5 112 Z22
> 
> #194 #223 #162 #101 #23 #25 #86 #216 <- translated to ascii decimals codes
> 
> 
> -------------------- Server -> canary build Chrome 7.0.513.0 or Safari 5.0.1 
> 
> HTTP/1.1 101 WebSocket Handshake Protocol
> Connection: Upgrade
> Upgrade: WebSocket
> Sec-Websocket-Origin: http://server01.alameda.cco:19009
> Sec-Websocket-Location: ws://192.168.3.3:19009/
> 
> #230 #171 #238 #85 #73 #252 #52 #120 #110 #142 #248 #64 #235 #48 #115 #180 <- translated to ascii decimals codes
Comment 2 Everton 2010-09-07 07:34:18 PDT
I found the error ... When I calculated the numbers of key1 and key2, I stored them in an integer (pascal) and when the number was larger than an integer value was 0, this explains the fact that sometimes connect and sometimes not. Solved by changing the integer to int64.
Thank you all.
Comment 3 Alexey Proskuryakov 2010-09-07 10:20:39 PDT
Marking as INVALID per the above. Thank you for following up!