Crashes in SocketStreamHandleBase::close
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 19:14:43 +0000 (19:14 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 19:14:43 +0000 (19:14 +0000)
commitf828999031fc886b25a579090274811f4473d1d3
tree0a48b6a7526886691a0d82988981c8c2f59f484e
parentce9b9232801663cdd9c127d3925e3373a8b8d1a8
Crashes in SocketStreamHandleBase::close
https://bugs.webkit.org/show_bug.cgi?id=144767
rdar://problem/20486538

Reviewed by Brady Eidson.

This is a speculative fix, I could not reproduce the crash.

* Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::processFrame):
Normally, processOutgoingFrameQueue() closes the handle in the end when called in
OutgoingFrameQueueClosing state. But there is no definitive protection against
processing two CLOSE frames, in which case we'd try to close the handle twice.

* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::readStreamCallback): Passing empty data to the client
results in the socket being closed, which makes no sense here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/websockets/WebSocketChannel.cpp
Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp