Bug 32355

Summary: Assertion failure when opening a WebSocket connection
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: PlatformAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: levin, ukai, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
proposed fix oliver: review+

Description Alexey Proskuryakov 2009-12-09 16:54:44 PST
In SocketStreamHandle::readStreamCallback,
        ASSERT(m_state == Open);

This happens because the stream can be unprepared to sending data yet (e.g. if read stream open callback arrived before the write one) and WebSocketChannel mistakenly treats zero return from platformSend() as an error - even though it just means that data was queued for later sending. So, the channel closes and destroys the handle.
Comment 1 Alexey Proskuryakov 2009-12-09 17:00:05 PST
Created attachment 44582 [details]
proposed fix
Comment 2 WebKit Review Bot 2009-12-09 17:02:41 PST
style-queue ran check-webkit-style on attachment 44582 [details] without any errors.
Comment 3 David Levin 2009-12-09 18:00:24 PST
Just fyi, typo in changelog: s/zero if returned/zero is returned/
Comment 4 Oliver Hunt 2009-12-09 19:02:46 PST
Comment on attachment 44582 [details]
proposed fix

r=me
Comment 5 Alexey Proskuryakov 2009-12-09 19:30:46 PST
Committed revision 51934.