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

Unified Diff: net/quic/quic_session.cc

Issue 1570343005: relnote: Implement server push methods in QuicSimpleServerSession. Only modify toy Quic server, not… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0044_CL_111708360
Patch Set: rebase to chain after fix Created 4 years, 11 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
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_spdy_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index bf1ba4a75d5ce85d94b0b40954591f385e50c4e9..24a6e99d6c2f9aff0084346d0be4cb5f927de225 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -170,10 +170,7 @@ void QuicSession::OnRstStream(const QuicRstStreamFrame& frame) {
ReliableQuicStream* stream = GetOrCreateDynamicStream(frame.stream_id);
if (!stream) {
- // The RST frame contains the final byte offset for the stream: we can now
- // update the connection level flow controller if needed.
- UpdateFlowControlOnFinalReceivedByteOffset(frame.stream_id,
- frame.byte_offset);
+ HandleRstOnValidNonexistentStream(frame);
return; // Errors are handled by GetStream.
}
@@ -511,6 +508,28 @@ void QuicSession::AdjustInitialFlowControlWindows(size_t stream_window) {
}
}
+void QuicSession::HandleFrameOnNonexistentOutgoingStream(
+ QuicStreamId stream_id) {
+ DCHECK(!IsClosedStream(stream_id));
+ // Received a frame for a locally-created stream that is not currently
+ // active. This is an error.
+ CloseConnectionWithDetails(QUIC_INVALID_STREAM_ID,
+ "Data for nonexistent stream");
+}
+
+void QuicSession::HandleRstOnValidNonexistentStream(
+ const QuicRstStreamFrame& frame) {
+ // If the stream is neither originally in active streams nor created in
+ // GetOrCreateDynamicStream(), it could be a closed stream in which case its
+ // final received byte offset need to be updated.
+ if (IsClosedStream(frame.stream_id)) {
+ // The RST frame contains the final byte offset for the stream: we can now
+ // update the connection level flow controller if needed.
+ UpdateFlowControlOnFinalReceivedByteOffset(frame.stream_id,
+ frame.byte_offset);
+ }
+}
+
void QuicSession::OnNewStreamFlowControlWindow(QuicStreamOffset new_window) {
if (new_window < kMinimumFlowControlSendWindow) {
LOG(ERROR) << "Peer sent us an invalid stream flow control send window: "
@@ -653,10 +672,7 @@ ReliableQuicStream* QuicSession::GetOrCreateDynamicStream(
}
if (!IsIncomingStream(stream_id)) {
- // Received a frame for a locally-created stream that is not currently
- // active. This is an error.
- CloseConnectionWithDetails(QUIC_INVALID_STREAM_ID,
- "Data for nonexistent stream");
+ HandleFrameOnNonexistentOutgoingStream(stream_id);
return nullptr;
}
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_spdy_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698