Bug 1213979 - h2 paket formats. r=hurley, a=al
authorCarsten Book <cbook@mozilla.com>
Mon, 19 Oct 2015 08:49:46 +0200
changeset 289574 ed67ac61d1c0
parent 289573 170d29280d87
child 289575 1153ec762010
push id5196
push usercbook@mozilla.com
push date2015-10-19 07:20 +0000
treeherdermozilla-beta@135164c79784 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley, al
bugs1213979
milestone42.0
Bug 1213979 - h2 paket 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);