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

Unified Diff: net/quic/quic_session.cc

Issue 605163004: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0925
Patch Set: Created 6 years, 3 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_sent_packet_manager_test.cc ('k') | net/quic/quic_session_test.cc » ('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 0f5be9c9dffd3b3f625dc6ee06dd45acbf6b70e7..8d82662fc1a2c5a7f1e25fa463032094fda4f4e2 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -16,6 +16,7 @@ using base::StringPiece;
using base::hash_map;
using base::hash_set;
using std::make_pair;
+using std::max;
using std::vector;
namespace net {
@@ -103,7 +104,7 @@ QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
: connection_(connection),
visitor_shim_(new VisitorShim(this)),
config_(config),
- max_open_streams_(config_.max_streams_per_connection()),
+ max_open_streams_(config_.MaxStreamsPerConnection()),
next_stream_id_(is_server() ? 2 : 5),
largest_peer_created_stream_id_(0),
error_(QUIC_NO_ERROR),
@@ -126,7 +127,7 @@ QuicSession::QuicSession(QuicConnection* connection, const QuicConfig& config)
void QuicSession::InitializeSession() {
connection_->set_visitor(visitor_shim_.get());
connection_->SetFromConfig(config_);
- if (connection_->connected()) {
+ if (!FLAGS_quic_unified_timeouts && connection_->connected()) {
connection_->SetOverallConnectionTimeout(
config_.max_time_before_crypto_handshake());
}
@@ -471,16 +472,19 @@ void QuicSession::OnConfigNegotiated() {
connection_->SetFromConfig(config_);
QuicVersion version = connection()->version();
- // A server should accept a small number of additional streams beyond the
- // limit sent to the client. This helps avoid early connection termination
- // when FIN/RSTs for old streams are lost or arrive out of order.
if (FLAGS_quic_allow_more_open_streams) {
- set_max_open_streams((is_server() ? kMaxStreamsMultiplier : 1.0) *
- config_.max_streams_per_connection());
- }
-
- if (version <= QUIC_VERSION_16) {
- return;
+ uint32 max_streams = config_.MaxStreamsPerConnection();
+ if (is_server()) {
+ // A server should accept a small number of additional streams beyond the
+ // limit sent to the client. This helps avoid early connection termination
+ // when FIN/RSTs for old streams are lost or arrive out of order.
+ // Use a minimum number of additional streams, or a percentage increase,
+ // whichever is larger.
+ max_streams =
+ max(max_streams + kMaxStreamsMinimumIncrement,
+ static_cast<uint32>(max_streams * kMaxStreamsMultiplier));
+ }
+ set_max_open_streams(max_streams);
}
if (version <= QUIC_VERSION_19) {
@@ -566,9 +570,11 @@ void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
// Discard originally encrypted packets, since they can't be decrypted by
// the peer.
connection_->NeuterUnencryptedPackets();
- connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite());
+ if (!FLAGS_quic_unified_timeouts) {
+ connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite());
+ }
if (!FLAGS_quic_allow_more_open_streams) {
- max_open_streams_ = config_.max_streams_per_connection();
+ max_open_streams_ = config_.MaxStreamsPerConnection();
}
break;
@@ -774,12 +780,6 @@ void QuicSession::OnSuccessfulVersionNegotiation(const QuicVersion& version) {
GetCryptoStream()->flow_controller()->Disable();
headers_stream_->flow_controller()->Disable();
}
- for (DataStreamMap::iterator it = stream_map_.begin();
- it != stream_map_.end(); ++it) {
- if (version <= QUIC_VERSION_16) {
- it->second->flow_controller()->Disable();
- }
- }
}
} // namespace net
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698