Bug 1283823 - ASpdySession::ForceIO() safety after h2 Shutdown(). r=hurley, a=gchang
authorPatrick McManus <mcmanus@ducksong.com>
Tue, 05 Jul 2016 17:43:21 -0400
changeset 333595 81a80d0c67a60eb82624a13be4d0d8851f9f09e1
parent 333594 24787f5d46cff354208970c6b366b268a44f365d
child 333596 60d09be974d615ae5c7fa1129516dbd0a6884dc5
push id6185
push usercbook@mozilla.com
push dateFri, 08 Jul 2016 07:53:48 +0000
treeherdermozilla-beta@60d09be974d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley, gchang
bugs1283823
milestone48.0
Bug 1283823 - ASpdySession::ForceIO() safety after h2 Shutdown(). r=hurley, a=gchang
netwerk/protocol/http/Http2Session.cpp
netwerk/protocol/http/SpdySession31.cpp
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -3574,18 +3574,23 @@ Http2Session::TransactionHasDataToWrite(
     LOG3(("Http2Session::TransactionHasDataToWrite %p caller %p not found",
           this, caller));
     return;
   }
 
   LOG3(("Http2Session::TransactionHasDataToWrite %p ID is 0x%X\n",
         this, stream->StreamID()));
 
-  mReadyForWrite.Push(stream);
-  SetWriteCallbacks();
+  if (!mClosed) {
+    mReadyForWrite.Push(stream);
+    SetWriteCallbacks();
+  } else {
+    LOG3(("Http2Session::TransactionHasDataToWrite %p closed so not setting Ready4Write\n",
+          this));
+  }
 
   // NSPR poll will not poll the network if there are non system PR_FileDesc's
   // that are ready - so we can get into a deadlock waiting for the system IO
   // to come back here if we don't force the send loop manually.
   ForceSend();
 }
 
 void
--- a/netwerk/protocol/http/SpdySession31.cpp
+++ b/netwerk/protocol/http/SpdySession31.cpp
@@ -2795,18 +2795,23 @@ SpdySession31::TransactionHasDataToWrite
     LOG3(("SpdySession31::TransactionHasDataToWrite %p caller %p not found",
           this, caller));
     return;
   }
 
   LOG3(("SpdySession31::TransactionHasDataToWrite %p ID is 0x%X\n",
         this, stream->StreamID()));
 
-  mReadyForWrite.Push(stream);
-  SetWriteCallbacks();
+  if (!mClosed) {
+    mReadyForWrite.Push(stream);
+    SetWriteCallbacks();
+  } else {
+    LOG3(("SpdySession31::TransactionHasDataToWrite %p closed so not setting Ready4Write\n",
+          this));
+  }
 
   // NSPR poll will not poll the network if there are non system PR_FileDesc's
   // that are ready - so we can get into a deadlock waiting for the system IO
   // to come back here if we don't force the send loop manually.
   ForceSend();
 }
 
 void