| 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;
|
| }
|
|
|
|
|