bug 679783 - websockets oninputstreamready() crash. r=jduell
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 26 Aug 2011 12:05:47 -0700
changeset 75958 cff7682167aab9811838880f26a9e25228dc367c
parent 75957 60594ddf3d9ea853b36cf2dab481bb77d0ef228f
child 75959 97d43d93ab55b2b00db0ca9ed3217764f758a739
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjduell
bugs679783
milestone9.0a1
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;