Bug 136178 - Keep list of weakPtrs instead of streamIds of streams started during 0rtt. r=mcmanus

This commit is contained in:
Dragana Damjanovic dd.mozilla@gmail.com 2017-05-09 11:37:45 +02:00
Родитель cdb9631de8
Коммит bf4c15a65c
3 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -2550,10 +2550,10 @@ Http2Session::ReadSegmentsAgain(nsAHttpSegmentReader *reader,
*countRead += earlyDataUsed;
}
if (mAttemptingEarlyData && !m0RTTStreams.Contains(stream->StreamID())) {
if (mAttemptingEarlyData && !m0RTTStreams.Contains(stream)) {
LOG3(("Http2Session::ReadSegmentsAgain adding stream %d to m0RTTStreams\n",
stream->StreamID()));
m0RTTStreams.AppendElement(stream->StreamID());
m0RTTStreams.AppendElement(stream);
}
// Not every permutation of stream->ReadSegents produces data (and therefore
@ -3121,9 +3121,8 @@ Http2Session::Finish0RTT(bool aRestart, bool aAlpnChanged)
aRestart, aAlpnChanged));
for (size_t i = 0; i < m0RTTStreams.Length(); ++i) {
Http2Stream *stream = mStreamIDHash.Get(m0RTTStreams[i]);
if (stream) {
stream->Finish0RTT(aRestart, aAlpnChanged);
if (m0RTTStreams[i]) {
m0RTTStreams[i]->Finish0RTT(aRestart, aAlpnChanged);
}
}
@ -3166,9 +3165,8 @@ Http2Session::SetFastOpenStatus(uint8_t aStatus)
aStatus, this));
for (size_t i = 0; i < m0RTTStreams.Length(); ++i) {
Http2Stream *stream = mStreamIDHash.Get(m0RTTStreams[i]);
if (stream) {
stream->Transaction()->SetFastOpenStatus(aStatus);
if (m0RTTStreams[i]) {
m0RTTStreams[i]->Transaction()->SetFastOpenStatus(aStatus);
}
}
}

Просмотреть файл

@ -520,7 +520,7 @@ private:
bool mAttemptingEarlyData;
// The ID(s) of the stream(s) that we are getting 0RTT data from.
nsTArray<uint32_t> m0RTTStreams;
nsTArray<WeakPtr<Http2Stream>> m0RTTStreams;
bool RealJoinConnection(const nsACString &hostname, int32_t port, bool jk);
bool TestOriginFrame(const nsACString &name, int32_t port);

Просмотреть файл

@ -32,8 +32,10 @@ class Http2Decompressor;
class Http2Stream
: public nsAHttpSegmentReader
, public nsAHttpSegmentWriter
, public SupportsWeakPtr<Http2Stream>
{
public:
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(Http2Stream)
NS_DECL_NSAHTTPSEGMENTREADER
NS_DECL_NSAHTTPSEGMENTWRITER