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" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 default: | 420 default: |
421 *error_details = "Bad " + QuicUtils::TagToString(tag_); | 421 *error_details = "Bad " + QuicUtils::TagToString(tag_); |
422 break; | 422 break; |
423 } | 423 } |
424 return error; | 424 return error; |
425 } | 425 } |
426 | 426 |
427 QuicConfig::QuicConfig() | 427 QuicConfig::QuicConfig() |
428 : max_time_before_crypto_handshake_(QuicTime::Delta::Zero()), | 428 : max_time_before_crypto_handshake_(QuicTime::Delta::Zero()), |
429 max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()), | 429 max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()), |
| 430 max_undecryptable_packets_(0), |
430 congestion_feedback_(kCGST, PRESENCE_REQUIRED), | 431 congestion_feedback_(kCGST, PRESENCE_REQUIRED), |
431 connection_options_(kCOPT, PRESENCE_OPTIONAL), | 432 connection_options_(kCOPT, PRESENCE_OPTIONAL), |
432 idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED), | 433 idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED), |
433 keepalive_timeout_seconds_(kKATO, PRESENCE_OPTIONAL), | 434 keepalive_timeout_seconds_(kKATO, PRESENCE_OPTIONAL), |
434 max_streams_per_connection_(kMSPC, PRESENCE_REQUIRED), | 435 max_streams_per_connection_(kMSPC, PRESENCE_REQUIRED), |
435 initial_congestion_window_(kSWND, PRESENCE_OPTIONAL), | 436 initial_congestion_window_(kSWND, PRESENCE_OPTIONAL), |
436 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), | 437 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), |
437 // TODO(rjshade): Remove this when retiring QUIC_VERSION_19. | 438 // TODO(rjshade): Remove this when retiring QUIC_VERSION_19. |
438 initial_flow_control_window_bytes_(kIFCW, PRESENCE_OPTIONAL), | 439 initial_flow_control_window_bytes_(kIFCW, PRESENCE_OPTIONAL), |
439 // TODO(rjshade): Make this PRESENCE_REQUIRED when retiring | 440 // TODO(rjshade): Make this PRESENCE_REQUIRED when retiring |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs, | 637 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs, |
637 kDefaultIdleTimeoutSecs); | 638 kDefaultIdleTimeoutSecs); |
638 // kKATO is optional. Return 0 if not negotiated. | 639 // kKATO is optional. Return 0 if not negotiated. |
639 keepalive_timeout_seconds_.set(0, 0); | 640 keepalive_timeout_seconds_.set(0, 0); |
640 SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection, | 641 SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection, |
641 kDefaultMaxStreamsPerConnection); | 642 kDefaultMaxStreamsPerConnection); |
642 max_time_before_crypto_handshake_ = | 643 max_time_before_crypto_handshake_ = |
643 QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs); | 644 QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs); |
644 max_idle_time_before_crypto_handshake_ = | 645 max_idle_time_before_crypto_handshake_ = |
645 QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs); | 646 QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs); |
| 647 max_undecryptable_packets_ = kDefaultMaxUndecryptablePackets; |
646 | 648 |
647 SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow); | 649 SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow); |
648 SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow); | 650 SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow); |
649 SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow); | 651 SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow); |
650 } | 652 } |
651 | 653 |
652 void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const { | 654 void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const { |
653 congestion_feedback_.ToHandshakeMessage(out); | 655 congestion_feedback_.ToHandshakeMessage(out); |
654 idle_connection_state_lifetime_seconds_.ToHandshakeMessage(out); | 656 idle_connection_state_lifetime_seconds_.ToHandshakeMessage(out); |
655 keepalive_timeout_seconds_.ToHandshakeMessage(out); | 657 keepalive_timeout_seconds_.ToHandshakeMessage(out); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 peer_hello, hello_type, error_details); | 713 peer_hello, hello_type, error_details); |
712 } | 714 } |
713 if (error == QUIC_NO_ERROR) { | 715 if (error == QUIC_NO_ERROR) { |
714 error = connection_options_.ProcessPeerHello( | 716 error = connection_options_.ProcessPeerHello( |
715 peer_hello, hello_type, error_details); | 717 peer_hello, hello_type, error_details); |
716 } | 718 } |
717 return error; | 719 return error; |
718 } | 720 } |
719 | 721 |
720 } // namespace net | 722 } // namespace net |
OLD | NEW |