Bug 32355 - Assertion failure when opening a WebSocket connection
Summary: Assertion failure when opening a WebSocket connection
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Alexey Proskuryakov
Depends on:
Reported: 2009-12-09 16:54 PST by Alexey Proskuryakov
Modified: 2009-12-09 19:30 PST (History)
3 users (show)

See Also:

proposed fix (3.14 KB, patch)
2009-12-09 17:00 PST, Alexey Proskuryakov
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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