| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_config.h" | 5 #include "net/quic/quic_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "net/quic/crypto/crypto_handshake_message.h" | 10 #include "net/quic/crypto/crypto_handshake_message.h" |
| 11 #include "net/quic/crypto/crypto_protocol.h" | 11 #include "net/quic/crypto/crypto_protocol.h" |
| 12 #include "net/quic/quic_flags.h" | |
| 13 #include "net/quic/quic_utils.h" | 12 #include "net/quic/quic_utils.h" |
| 14 | 13 |
| 15 using std::min; | 14 using std::min; |
| 16 using std::string; | 15 using std::string; |
| 17 | 16 |
| 18 namespace net { | 17 namespace net { |
| 19 | 18 |
| 20 // Reads the value corresponding to |name_| from |msg| into |out|. If the | 19 // Reads the value corresponding to |name_| from |msg| into |out|. If the |
| 21 // |name_| is absent in |msg| and |presence| is set to OPTIONAL |out| is set | 20 // |name_| is absent in |msg| and |presence| is set to OPTIONAL |out| is set |
| 22 // to |default_value|. | 21 // to |default_value|. |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 void QuicConfig::SetDefaults() { | 600 void QuicConfig::SetDefaults() { |
| 602 QuicTagVector congestion_feedback; | 601 QuicTagVector congestion_feedback; |
| 603 // TODO(alyssar) stop sending this once QUIC_VERSION_23 is sunset. | 602 // TODO(alyssar) stop sending this once QUIC_VERSION_23 is sunset. |
| 604 // This field was required until version 22 was removed but by the time | 603 // This field was required until version 22 was removed but by the time |
| 605 // QUIC_VERSION_23 is sunset, no users of QUIC_VERSION_24 should be expecting | 604 // QUIC_VERSION_23 is sunset, no users of QUIC_VERSION_24 should be expecting |
| 606 // it. | 605 // it. |
| 607 congestion_feedback.push_back(kQBIC); | 606 congestion_feedback.push_back(kQBIC); |
| 608 congestion_feedback_.set(congestion_feedback, kQBIC); | 607 congestion_feedback_.set(congestion_feedback, kQBIC); |
| 609 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs, | 608 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs, |
| 610 kDefaultIdleTimeoutSecs); | 609 kDefaultIdleTimeoutSecs); |
| 611 if (FLAGS_quic_allow_silent_close) { | 610 silent_close_.set(1, 0); |
| 612 silent_close_.set(1, 0); | |
| 613 } else { | |
| 614 silent_close_.set(0, 0); | |
| 615 } | |
| 616 SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection, | 611 SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection, |
| 617 kDefaultMaxStreamsPerConnection); | 612 kDefaultMaxStreamsPerConnection); |
| 618 max_time_before_crypto_handshake_ = | 613 max_time_before_crypto_handshake_ = |
| 619 QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs); | 614 QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs); |
| 620 max_idle_time_before_crypto_handshake_ = | 615 max_idle_time_before_crypto_handshake_ = |
| 621 QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs); | 616 QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs); |
| 622 max_undecryptable_packets_ = kDefaultMaxUndecryptablePackets; | 617 max_undecryptable_packets_ = kDefaultMaxUndecryptablePackets; |
| 623 | 618 |
| 624 SetInitialStreamFlowControlWindowToSend(kMinimumFlowControlSendWindow); | 619 SetInitialStreamFlowControlWindowToSend(kMinimumFlowControlSendWindow); |
| 625 SetInitialSessionFlowControlWindowToSend(kMinimumFlowControlSendWindow); | 620 SetInitialSessionFlowControlWindowToSend(kMinimumFlowControlSendWindow); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 peer_hello, hello_type, error_details); | 673 peer_hello, hello_type, error_details); |
| 679 } | 674 } |
| 680 if (error == QUIC_NO_ERROR) { | 675 if (error == QUIC_NO_ERROR) { |
| 681 error = connection_options_.ProcessPeerHello( | 676 error = connection_options_.ProcessPeerHello( |
| 682 peer_hello, hello_type, error_details); | 677 peer_hello, hello_type, error_details); |
| 683 } | 678 } |
| 684 return error; | 679 return error; |
| 685 } | 680 } |
| 686 | 681 |
| 687 } // namespace net | 682 } // namespace net |
| OLD | NEW |