| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 } | 587 } |
| 588 | 588 |
| 589 uint32 QuicConfig::ReceivedSocketReceiveBuffer() const { | 589 uint32 QuicConfig::ReceivedSocketReceiveBuffer() const { |
| 590 return socket_receive_buffer_.GetReceivedValue(); | 590 return socket_receive_buffer_.GetReceivedValue(); |
| 591 } | 591 } |
| 592 | 592 |
| 593 bool QuicConfig::negotiated() const { | 593 bool QuicConfig::negotiated() const { |
| 594 // TODO(ianswett): Add the negotiated parameters once and iterate over all | 594 // TODO(ianswett): Add the negotiated parameters once and iterate over all |
| 595 // of them in negotiated, ToHandshakeMessage, ProcessClientHello, and | 595 // of them in negotiated, ToHandshakeMessage, ProcessClientHello, and |
| 596 // ProcessServerHello. | 596 // ProcessServerHello. |
| 597 return idle_connection_state_lifetime_seconds_.negotiated() && | 597 return congestion_feedback_.negotiated() && |
| 598 max_streams_per_connection_.negotiated(); | 598 idle_connection_state_lifetime_seconds_.negotiated() && |
| 599 max_streams_per_connection_.negotiated(); |
| 599 } | 600 } |
| 600 | 601 |
| 601 void QuicConfig::SetDefaults() { | 602 void QuicConfig::SetDefaults() { |
| 602 QuicTagVector congestion_feedback; | 603 QuicTagVector congestion_feedback; |
| 603 // TODO(alyssar) stop sending this once QUIC_VERSION_23 is sunset. | 604 // 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 | 605 // 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 | 606 // QUIC_VERSION_23 is sunset, no users of QUIC_VERSION_24 should be expecting |
| 606 // it. | 607 // it. |
| 607 congestion_feedback.push_back(kQBIC); | 608 congestion_feedback.push_back(kQBIC); |
| 608 congestion_feedback_.set(congestion_feedback, kQBIC); | 609 congestion_feedback_.set(congestion_feedback, kQBIC); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 639 } | 640 } |
| 640 | 641 |
| 641 QuicErrorCode QuicConfig::ProcessPeerHello( | 642 QuicErrorCode QuicConfig::ProcessPeerHello( |
| 642 const CryptoHandshakeMessage& peer_hello, | 643 const CryptoHandshakeMessage& peer_hello, |
| 643 HelloType hello_type, | 644 HelloType hello_type, |
| 644 string* error_details) { | 645 string* error_details) { |
| 645 DCHECK(error_details != nullptr); | 646 DCHECK(error_details != nullptr); |
| 646 | 647 |
| 647 QuicErrorCode error = QUIC_NO_ERROR; | 648 QuicErrorCode error = QUIC_NO_ERROR; |
| 648 if (error == QUIC_NO_ERROR) { | 649 if (error == QUIC_NO_ERROR) { |
| 650 error = congestion_feedback_.ProcessPeerHello( |
| 651 peer_hello, hello_type, error_details); |
| 652 } |
| 653 if (error == QUIC_NO_ERROR) { |
| 649 error = idle_connection_state_lifetime_seconds_.ProcessPeerHello( | 654 error = idle_connection_state_lifetime_seconds_.ProcessPeerHello( |
| 650 peer_hello, hello_type, error_details); | 655 peer_hello, hello_type, error_details); |
| 651 } | 656 } |
| 652 if (error == QUIC_NO_ERROR) { | 657 if (error == QUIC_NO_ERROR) { |
| 653 error = | 658 error = |
| 654 silent_close_.ProcessPeerHello(peer_hello, hello_type, error_details); | 659 silent_close_.ProcessPeerHello(peer_hello, hello_type, error_details); |
| 655 } | 660 } |
| 656 if (error == QUIC_NO_ERROR) { | 661 if (error == QUIC_NO_ERROR) { |
| 657 error = max_streams_per_connection_.ProcessPeerHello( | 662 error = max_streams_per_connection_.ProcessPeerHello( |
| 658 peer_hello, hello_type, error_details); | 663 peer_hello, hello_type, error_details); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 678 peer_hello, hello_type, error_details); | 683 peer_hello, hello_type, error_details); |
| 679 } | 684 } |
| 680 if (error == QUIC_NO_ERROR) { | 685 if (error == QUIC_NO_ERROR) { |
| 681 error = connection_options_.ProcessPeerHello( | 686 error = connection_options_.ProcessPeerHello( |
| 682 peer_hello, hello_type, error_details); | 687 peer_hello, hello_type, error_details); |
| 683 } | 688 } |
| 684 return error; | 689 return error; |
| 685 } | 690 } |
| 686 | 691 |
| 687 } // namespace net | 692 } // namespace net |
| OLD | NEW |