Bug 1424915 - Close a httpTransaction from a http2session with the right error code if the error code is NS_BINDING_RETARGETED. Otherwise the transaction will be restarted twice. r=mcmanus a=gchang
authorDragana Damjanovic <dd.mozilla@gmail.com>
Thu, 14 Dec 2017 10:35:54 +0100
changeset 445378 94e939c04e269ad8f8c454a1b3b5635c2ccff8c5
parent 445377 5b2c850b512167b1dc56194d2e1e82072a7f7c3a
child 445379 5b0cbe526004529e7a58c15d54917f0e1d7c556e
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, gchang
bugs1424915
milestone58.0
Bug 1424915 - Close a httpTransaction from a http2session with the right error code if the error code is NS_BINDING_RETARGETED. Otherwise the transaction will be restarted twice. r=mcmanus a=gchang
netwerk/protocol/http/Http2Session.cpp
--- a/netwerk/protocol/http/Http2Session.cpp
+++ b/netwerk/protocol/http/Http2Session.cpp
@@ -3245,17 +3245,19 @@ Http2Session::WriteSegmentsAgain(nsAHttp
 
       if (mInputFrameDataRead == mInputFrameDataSize)
         ResetDownstreamState();
       LOG3(("Http2Session::WriteSegments session=%p id 0x%X "
             "needscleanup=%p. cleanup stream based on "
             "stream->writeSegments returning code %" PRIx32 "\n",
             this, streamID, mNeedsCleanup, static_cast<uint32_t>(rv)));
       MOZ_ASSERT(!mNeedsCleanup || mNeedsCleanup->StreamID() == streamID);
-      CleanupStream(streamID, NS_OK, CANCEL_ERROR);
+      CleanupStream(streamID,
+                    (rv == NS_BINDING_RETARGETED) ? NS_BINDING_RETARGETED : NS_OK,
+                    CANCEL_ERROR);
       mNeedsCleanup = nullptr;
       *again = false;
       rv = ResumeRecv();
       if (NS_FAILED(rv)) {
         LOG3(("ResumeRecv returned code %x", static_cast<uint32_t>(rv)));
       }
       return NS_OK;
     }