зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1228822 - Ensure we send out the window update when matching a pushed stream with a pull stream. r=mcmanus
--HG-- extra : commitid : D6pRH1pTQe6 extra : rebase_source : 0b1d5f10a9ebeda7b037e2c147f426908ef241a2
This commit is contained in:
Родитель
b95ff06630
Коммит
a6d6d5ef55
|
@ -173,6 +173,22 @@ Http2PushedStream::ReadSegments(nsAHttpSegmentReader *,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Http2PushedStream::AdjustInitialWindow()
|
||||||
|
{
|
||||||
|
LOG3(("Http2PushStream %p 0x%X AdjustInitialWindow", this, mStreamID));
|
||||||
|
if (mConsumerStream) {
|
||||||
|
LOG3(("Http2PushStream::AdjustInitialWindow %p 0x%X calling super %p", this,
|
||||||
|
mStreamID, mConsumerStream));
|
||||||
|
Http2Stream::AdjustInitialWindow();
|
||||||
|
// We have to use mConsumerStream here because our ReadSegments is a nop for
|
||||||
|
// actually sending data.
|
||||||
|
mSession->TransactionHasDataToWrite(mConsumerStream);
|
||||||
|
}
|
||||||
|
// Otherwise, when we get hooked up, the initial window will get bumped
|
||||||
|
// anyway, so we're good to go.
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Http2PushedStream::SetConsumerStream(Http2Stream *consumer)
|
Http2PushedStream::SetConsumerStream(Http2Stream *consumer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
// override of Http2Stream
|
// override of Http2Stream
|
||||||
nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *) override;
|
nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *) override;
|
||||||
nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *) override;
|
nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *) override;
|
||||||
|
void AdjustInitialWindow() override;
|
||||||
|
|
||||||
nsISchedulingContext *SchedulingContext() override { return mSchedulingContext; };
|
nsISchedulingContext *SchedulingContext() override { return mSchedulingContext; };
|
||||||
void ConnectPushedStream(Http2Stream *consumer);
|
void ConnectPushedStream(Http2Stream *consumer);
|
||||||
|
|
|
@ -67,6 +67,7 @@ Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction,
|
||||||
, mRequestBodyLenRemaining(0)
|
, mRequestBodyLenRemaining(0)
|
||||||
, mLocalUnacked(0)
|
, mLocalUnacked(0)
|
||||||
, mBlockedOnRwin(false)
|
, mBlockedOnRwin(false)
|
||||||
|
, mSentPushWindowBump(false)
|
||||||
, mTotalSent(0)
|
, mTotalSent(0)
|
||||||
, mTotalRead(0)
|
, mTotalRead(0)
|
||||||
, mPushSource(nullptr)
|
, mPushSource(nullptr)
|
||||||
|
@ -478,8 +479,8 @@ Http2Stream::ParseHttpRequestHeaders(const char *buf,
|
||||||
mSession, hashkey.get(), schedulingContext, cache, pushedStream));
|
mSession, hashkey.get(), schedulingContext, cache, pushedStream));
|
||||||
|
|
||||||
if (pushedStream) {
|
if (pushedStream) {
|
||||||
LOG3(("Pushed Stream Match located id=0x%X key=%s\n",
|
LOG3(("Pushed Stream Match located %p id=0x%X key=%s\n",
|
||||||
pushedStream->StreamID(), hashkey.get()));
|
pushedStream, pushedStream->StreamID(), hashkey.get()));
|
||||||
pushedStream->SetConsumerStream(this);
|
pushedStream->SetConsumerStream(this);
|
||||||
mPushSource = pushedStream;
|
mPushSource = pushedStream;
|
||||||
SetSentFin(true);
|
SetSentFin(true);
|
||||||
|
@ -1386,6 +1387,14 @@ Http2Stream::OnReadSegment(const char *buf,
|
||||||
MOZ_ASSERT(false, "resuming partial fin stream out of OnReadSegment");
|
MOZ_ASSERT(false, "resuming partial fin stream out of OnReadSegment");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case UPSTREAM_COMPLETE:
|
||||||
|
MOZ_ASSERT(mPushSource && !mSentPushWindowBump, "unexpected upstream_complete");
|
||||||
|
rv = TransmitFrame(nullptr, nullptr, true);
|
||||||
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
mSentPushWindowBump = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MOZ_ASSERT(false, "Http2Stream::OnReadSegment non-write state");
|
MOZ_ASSERT(false, "Http2Stream::OnReadSegment non-write state");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -200,6 +200,8 @@ protected:
|
||||||
|
|
||||||
void ChangeState(enum upstreamStateType);
|
void ChangeState(enum upstreamStateType);
|
||||||
|
|
||||||
|
virtual void AdjustInitialWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class nsAutoPtr<Http2Stream>;
|
friend class nsAutoPtr<Http2Stream>;
|
||||||
|
|
||||||
|
@ -207,7 +209,6 @@ private:
|
||||||
nsresult GenerateOpen();
|
nsresult GenerateOpen();
|
||||||
|
|
||||||
void AdjustPushedPriority();
|
void AdjustPushedPriority();
|
||||||
void AdjustInitialWindow();
|
|
||||||
nsresult TransmitFrame(const char *, uint32_t *, bool forceCommitment);
|
nsresult TransmitFrame(const char *, uint32_t *, bool forceCommitment);
|
||||||
void GenerateDataFrameHeader(uint32_t, bool);
|
void GenerateDataFrameHeader(uint32_t, bool);
|
||||||
|
|
||||||
|
@ -312,6 +313,9 @@ private:
|
||||||
// <= 0
|
// <= 0
|
||||||
bool mBlockedOnRwin;
|
bool mBlockedOnRwin;
|
||||||
|
|
||||||
|
// For properly adjusting push stream windows - see bug 1228822
|
||||||
|
bool mSentPushWindowBump;
|
||||||
|
|
||||||
// For Progress Events
|
// For Progress Events
|
||||||
uint64_t mTotalSent;
|
uint64_t mTotalSent;
|
||||||
uint64_t mTotalRead;
|
uint64_t mTotalRead;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче