bug 679783 - websockets oninputstreamready() crash. r=jduell
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 26 Aug 2011 12:05:47 -0700
changeset 77269 cff7682167aab9811838880f26a9e25228dc367c
parent 77268 60594ddf3d9ea853b36cf2dab481bb77d0ef228f
child 77270 97d43d93ab55b2b00db0ca9ed3217764f758a739
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs679783
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 679783 - websockets oninputstreamready() crash. r=jduell
netwerk/protocol/websocket/WebSocketChannel.cpp
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -2399,16 +2399,19 @@ WebSocketChannel::OnStopRequest(nsIReque
 // nsIInputStreamCallback
 
 NS_IMETHODIMP
 WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream)
 {
   LOG(("WebSocketChannel::OnInputStreamReady() %p\n", this));
   NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "not socket thread");
 
+  if (!mSocketIn) // did we we clean up the socket after scheduling InputReady?
+    return NS_OK;
+  
   nsRefPtr<nsIStreamListener>    deleteProtector1(mInflateReader);
   nsRefPtr<nsIStringInputStream> deleteProtector2(mInflateStream);
 
   // this is after the  http upgrade - so we are speaking websockets
   char  buffer[2048];
   PRUint32 count;
   nsresult rv;