Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: webrtc/p2p/quic/quicsession.cc

Issue 1888903002: Fix QuicSession to unbuffer data when the QuicTransportChannel reconnects (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698