OLD | NEW |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 flow_controller_.reset(new QuicFlowController( | 120 flow_controller_.reset(new QuicFlowController( |
121 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, | 121 connection_.get(), 0, is_server(), kDefaultFlowControlSendWindow, |
122 config_.GetInitialSessionFlowControlWindowToSend(), | 122 config_.GetInitialSessionFlowControlWindowToSend(), |
123 config_.GetInitialSessionFlowControlWindowToSend())); | 123 config_.GetInitialSessionFlowControlWindowToSend())); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 void QuicSession::InitializeSession() { | 127 void QuicSession::InitializeSession() { |
128 connection_->set_visitor(visitor_shim_.get()); | 128 connection_->set_visitor(visitor_shim_.get()); |
129 connection_->SetFromConfig(config_); | 129 connection_->SetFromConfig(config_); |
130 if (connection_->connected()) { | 130 if (!FLAGS_quic_unified_timeouts && connection_->connected()) { |
131 connection_->SetOverallConnectionTimeout( | 131 connection_->SetOverallConnectionTimeout( |
132 config_.max_time_before_crypto_handshake()); | 132 config_.max_time_before_crypto_handshake()); |
133 } | 133 } |
134 headers_stream_.reset(new QuicHeadersStream(this)); | 134 headers_stream_.reset(new QuicHeadersStream(this)); |
135 } | 135 } |
136 | 136 |
137 QuicSession::~QuicSession() { | 137 QuicSession::~QuicSession() { |
138 STLDeleteElements(&closed_streams_); | 138 STLDeleteElements(&closed_streams_); |
139 STLDeleteValues(&stream_map_); | 139 STLDeleteValues(&stream_map_); |
140 | 140 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // decrypted by the peer. | 563 // decrypted by the peer. |
564 connection_->RetransmitUnackedPackets(ALL_INITIAL_RETRANSMISSION); | 564 connection_->RetransmitUnackedPackets(ALL_INITIAL_RETRANSMISSION); |
565 break; | 565 break; |
566 | 566 |
567 case HANDSHAKE_CONFIRMED: | 567 case HANDSHAKE_CONFIRMED: |
568 LOG_IF(DFATAL, !config_.negotiated()) << ENDPOINT | 568 LOG_IF(DFATAL, !config_.negotiated()) << ENDPOINT |
569 << "Handshake confirmed without parameter negotiation."; | 569 << "Handshake confirmed without parameter negotiation."; |
570 // Discard originally encrypted packets, since they can't be decrypted by | 570 // Discard originally encrypted packets, since they can't be decrypted by |
571 // the peer. | 571 // the peer. |
572 connection_->NeuterUnencryptedPackets(); | 572 connection_->NeuterUnencryptedPackets(); |
573 connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite()); | 573 if (!FLAGS_quic_unified_timeouts) { |
| 574 connection_->SetOverallConnectionTimeout(QuicTime::Delta::Infinite()); |
| 575 } |
574 if (!FLAGS_quic_allow_more_open_streams) { | 576 if (!FLAGS_quic_allow_more_open_streams) { |
575 max_open_streams_ = config_.MaxStreamsPerConnection(); | 577 max_open_streams_ = config_.MaxStreamsPerConnection(); |
576 } | 578 } |
577 break; | 579 break; |
578 | 580 |
579 default: | 581 default: |
580 LOG(ERROR) << ENDPOINT << "Got unknown handshake event: " << event; | 582 LOG(ERROR) << ENDPOINT << "Got unknown handshake event: " << event; |
581 } | 583 } |
582 } | 584 } |
583 | 585 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 776 |
775 // Disable stream level flow control based on negotiated version. Streams may | 777 // Disable stream level flow control based on negotiated version. Streams may |
776 // have been created with a different version. | 778 // have been created with a different version. |
777 if (version < QUIC_VERSION_21) { | 779 if (version < QUIC_VERSION_21) { |
778 GetCryptoStream()->flow_controller()->Disable(); | 780 GetCryptoStream()->flow_controller()->Disable(); |
779 headers_stream_->flow_controller()->Disable(); | 781 headers_stream_->flow_controller()->Disable(); |
780 } | 782 } |
781 } | 783 } |
782 | 784 |
783 } // namespace net | 785 } // namespace net |
OLD | NEW |