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 341882 0b0baefc7f44e41a4b1be47eab65b991be40b255
parent 341881 e2a02d7d4e71cb0a1dbfaca264a6bfbe8a169009
child 341883 02e9aeb2797307e4ac68ceaed3b3c1c0644da8ec
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley, gchang
bugs1283823
milestone49.0a2
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
@@ -3576,18 +3576,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
@@ -2797,18 +2797,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