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

Unified Diff: net/quic/quic_session.cc

Issue 15937012: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small bug fixes Created 7 years, 7 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: net/quic/quic_session.cc
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index 12bec2628ef21e3ed693cb9cb7a19ea79c13883a..2ed5b073e181a63d75ad875d686cf1bbdffeff0d 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -76,7 +76,13 @@ QuicSession::QuicSession(QuicConnection* connection,
largest_peer_created_stream_id_(0),
goaway_received_(false),
goaway_sent_(false) {
- connection->set_visitor(visitor_shim_.get());
+ set_max_open_streams(config_.max_streams_per_connection());
+
+ connection_->set_visitor(visitor_shim_.get());
+ connection_->SetIdleNetworkTimeout(config_.idle_connection_state_lifetime());
+ connection_->SetOverallConnectionTimeout(
+ config_.max_time_before_crypto_handshake());
+ // TODO(satyamshekhar): Set congestion control and ICSL also.
}
QuicSession::~QuicSession() {
@@ -114,16 +120,17 @@ bool QuicSession::OnPacket(const IPEndPoint& self_address,
while (!decompression_blocked_streams_.empty()) {
QuicHeaderId header_id = decompression_blocked_streams_.begin()->first;
- if (header_id == decompressor_.current_header_id()) {
- QuicStreamId stream_id = decompression_blocked_streams_.begin()->second;
- decompression_blocked_streams_.erase(header_id);
- ReliableQuicStream* stream = GetStream(stream_id);
- if (!stream) {
- connection()->SendConnectionClose(
- QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED);
- }
- stream->OnDecompressorAvailable();
+ if (header_id != decompressor_.current_header_id()) {
+ break;
+ }
+ QuicStreamId stream_id = decompression_blocked_streams_.begin()->second;
+ decompression_blocked_streams_.erase(header_id);
+ ReliableQuicStream* stream = GetStream(stream_id);
+ if (!stream) {
+ connection()->SendConnectionClose(
+ QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED);
}
+ stream->OnDecompressorAvailable();
}
return true;
}
@@ -232,8 +239,9 @@ void QuicSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
case HANDSHAKE_CONFIRMED:
LOG_IF(DFATAL, !config_.negotiated())
<< "Handshake confirmed without parameter negotiation.";
- connection_->SetConnectionTimeout(
+ connection_->SetIdleNetworkTimeout(
config_.idle_connection_state_lifetime());
+ connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite());
max_open_streams_ = config_.max_streams_per_connection();
break;

Powered by Google App Engine
This is Rietveld 408576698