Index: webrtc/p2p/quic/quicsession.cc |
diff --git a/webrtc/p2p/quic/quicsession.cc b/webrtc/p2p/quic/quicsession.cc |
index a70aa0b01d2e1a62986807855c32daaf047cfb70..028839d6d40d9ce42fb66dfe28a90c9628cdadeb 100644 |
--- a/webrtc/p2p/quic/quicsession.cc |
+++ b/webrtc/p2p/quic/quicsession.cc |
@@ -62,6 +62,18 @@ void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { |
} |
} |
+void QuicSession::CloseStream(net::QuicStreamId stream_id) { |
+ if (IsClosedStream(stream_id)) { |
+ // When CloseStream has been called recursively (via |
+ // ReliableQuicStream::OnClose), the stream is already closed so return. |
+ return; |
+ } |
+ if (!IsIncomingStream(stream_id)) { |
pthatcher1
2016/04/29 20:15:46
What happens if we call write_blocked_streams()->U
mikescarlett
2016/04/29 23:29:50
write_blocked_streams()->UnregisterStream(stream_i
|
+ write_blocked_streams()->UnregisterStream(stream_id); |
+ } |
+ net::QuicSession::CloseStream(stream_id); |
+} |
+ |
ReliableQuicStream* QuicSession::CreateIncomingDynamicStream( |
net::QuicStreamId id) { |
ReliableQuicStream* stream = CreateDataStream(id); |
@@ -76,6 +88,10 @@ ReliableQuicStream* QuicSession::CreateOutgoingDynamicStream( |
ReliableQuicStream* stream = CreateDataStream(GetNextOutgoingStreamId()); |
if (stream) { |
ActivateStream(stream); // QuicSession owns the stream. |
+ // Register the stream to the QuicWriteBlockedList. |priority| is clamped |
+ // between 0 and 7, with 0 being the highest priority and 7 the lowest |
+ // priority. |
+ write_blocked_streams()->RegisterStream(stream->id(), priority); |
} |
return stream; |
} |