Bug 1213979 - h2 packet formats. r=hurley, a=al
authorCarsten Book <cbook@mozilla.com>
Mon, 19 Oct 2015 08:49:46 +0200
changeset 296490 551a28778624d4aff67b698952b1b3e011fc21f7
parent 296489 26ef53809ca7f6daf9c6f7765f7313000fe93275
child 296491 85ec9994546feac0447d11dd1b7bdb87c4058d72
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley, al
bugs1213979
milestone43.0a2
Bug 1213979 - h2 packet formats. r=hurley, a=al
netwerk/protocol/http/Http2Stream.cpp
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -624,19 +624,19 @@ Http2Stream::AdjustInitialWindow()
   }
 
   MOZ_ASSERT(mClientReceiveWindow <= ASpdySession::kInitialRwin);
   uint32_t bump = ASpdySession::kInitialRwin - mClientReceiveWindow;
   if (!bump) { // nothing to do
     return;
   }
 
-  uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed;
   EnsureBuffer(mTxInlineFrame, mTxInlineFrameUsed + Http2Session::kFrameHeaderBytes + 4,
                mTxInlineFrameUsed, mTxInlineFrameSize);
+  uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed;
   mTxInlineFrameUsed += Http2Session::kFrameHeaderBytes + 4;
 
   mSession->CreateFrameHeader(packet, 4,
                               Http2Session::FRAME_TYPE_WINDOW_UPDATE,
                               0, stream->mStreamID);
 
   mClientReceiveWindow += bump;
   bump = PR_htonl(bump);
@@ -656,19 +656,19 @@ Http2Stream::AdjustPushedPriority()
 
   MOZ_ASSERT(mPushSource->mStreamID && !(mPushSource->mStreamID & 1));
 
   // If the pushed stream has recvd a FIN, there is no reason to update
   // the window
   if (mPushSource->RecvdFin() || mPushSource->RecvdReset())
     return;
 
-  uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed;
   EnsureBuffer(mTxInlineFrame, mTxInlineFrameUsed + Http2Session::kFrameHeaderBytes + 5,
                mTxInlineFrameUsed, mTxInlineFrameSize);
+  uint8_t *packet = mTxInlineFrame.get() + mTxInlineFrameUsed;
   mTxInlineFrameUsed += Http2Session::kFrameHeaderBytes + 5;
 
   mSession->CreateFrameHeader(packet, 5,
                               Http2Session::FRAME_TYPE_PRIORITY,
                               Http2Session::kFlag_PRIORITY,
                               mPushSource->mStreamID);
 
   mPushSource->SetPriority(mPriority);