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

Side by Side Diff: net/quic/quic_session.cc

Issue 448973002: Close a QUIC connection if there are too many unfinished streams being (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_unused_version_argument_72559549
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_session.h" 5 #include "net/quic/quic_session.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/proof_verifier.h" 8 #include "net/quic/crypto/proof_verifier.h"
9 #include "net/quic/quic_connection.h" 9 #include "net/quic/quic_connection.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 closed_streams_.push_back(it->second); 424 closed_streams_.push_back(it->second);
425 425
426 // If we haven't received a FIN or RST for this stream, we need to keep track 426 // If we haven't received a FIN or RST for this stream, we need to keep track
427 // of the how many bytes the stream's flow controller believes it has 427 // of the how many bytes the stream's flow controller believes it has
428 // received, for accurate connection level flow control accounting. 428 // received, for accurate connection level flow control accounting.
429 if (!stream->HasFinalReceivedByteOffset() && 429 if (!stream->HasFinalReceivedByteOffset() &&
430 stream->flow_controller()->IsEnabled()) { 430 stream->flow_controller()->IsEnabled()) {
431 locally_closed_streams_highest_offset_[stream_id] = 431 locally_closed_streams_highest_offset_[stream_id] =
432 stream->flow_controller()->highest_received_byte_offset(); 432 stream->flow_controller()->highest_received_byte_offset();
433 if (FLAGS_close_quic_connection_unfinished_streams &&
434 connection()->connected() &&
435 locally_closed_streams_highest_offset_.size() > max_open_streams_) {
436 // A buggy client may fail to send FIN/RSTs. Don't tolerate this.
437 connection_->SendConnectionClose(QUIC_TOO_MANY_UNFINISHED_STREAMS);
438 }
433 } 439 }
434 440
435 stream_map_.erase(it); 441 stream_map_.erase(it);
436 stream->OnClose(); 442 stream->OnClose();
437 } 443 }
438 444
439 void QuicSession::UpdateFlowControlOnFinalReceivedByteOffset( 445 void QuicSession::UpdateFlowControlOnFinalReceivedByteOffset(
440 QuicStreamId stream_id, QuicStreamOffset final_byte_offset) { 446 QuicStreamId stream_id, QuicStreamOffset final_byte_offset) {
441 map<QuicStreamId, QuicStreamOffset>::iterator it = 447 map<QuicStreamId, QuicStreamOffset>::iterator it =
442 locally_closed_streams_highest_offset_.find(stream_id); 448 locally_closed_streams_highest_offset_.find(stream_id);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 } 761 }
756 for (DataStreamMap::iterator it = stream_map_.begin(); 762 for (DataStreamMap::iterator it = stream_map_.begin();
757 it != stream_map_.end(); ++it) { 763 it != stream_map_.end(); ++it) {
758 if (version <= QUIC_VERSION_16) { 764 if (version <= QUIC_VERSION_16) {
759 it->second->flow_controller()->Disable(); 765 it->second->flow_controller()->Disable();
760 } 766 }
761 } 767 }
762 } 768 }
763 769
764 } // namespace net 770 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698