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

Side by Side Diff: net/quic/quic_config.cc

Issue 898233003: Making the (deprecation-in-progress) congestion field write only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Improving_junk_packet_handling_85067984
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/test_tools/quic_config_peer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 congestion_feedback_.negotiated() && 597 return idle_connection_state_lifetime_seconds_.negotiated() &&
598 idle_connection_state_lifetime_seconds_.negotiated() && 598 max_streams_per_connection_.negotiated();
599 max_streams_per_connection_.negotiated();
600 } 599 }
601 600
602 void QuicConfig::SetDefaults() { 601 void QuicConfig::SetDefaults() {
603 QuicTagVector congestion_feedback; 602 QuicTagVector congestion_feedback;
604 // TODO(alyssar) stop sending this once QUIC_VERSION_23 is sunset. 603 // TODO(alyssar) stop sending this once QUIC_VERSION_23 is sunset.
605 // This field was required until version 22 was removed but by the time 604 // This field was required until version 22 was removed but by the time
606 // QUIC_VERSION_23 is sunset, no users of QUIC_VERSION_24 should be expecting 605 // QUIC_VERSION_23 is sunset, no users of QUIC_VERSION_24 should be expecting
607 // it. 606 // it.
608 congestion_feedback.push_back(kQBIC); 607 congestion_feedback.push_back(kQBIC);
609 congestion_feedback_.set(congestion_feedback, kQBIC); 608 congestion_feedback_.set(congestion_feedback, kQBIC);
(...skipping 30 matching lines...) Expand all
640 } 639 }
641 640
642 QuicErrorCode QuicConfig::ProcessPeerHello( 641 QuicErrorCode QuicConfig::ProcessPeerHello(
643 const CryptoHandshakeMessage& peer_hello, 642 const CryptoHandshakeMessage& peer_hello,
644 HelloType hello_type, 643 HelloType hello_type,
645 string* error_details) { 644 string* error_details) {
646 DCHECK(error_details != nullptr); 645 DCHECK(error_details != nullptr);
647 646
648 QuicErrorCode error = QUIC_NO_ERROR; 647 QuicErrorCode error = QUIC_NO_ERROR;
649 if (error == QUIC_NO_ERROR) { 648 if (error == QUIC_NO_ERROR) {
650 error = congestion_feedback_.ProcessPeerHello(
651 peer_hello, hello_type, error_details);
652 }
653 if (error == QUIC_NO_ERROR) {
654 error = idle_connection_state_lifetime_seconds_.ProcessPeerHello( 649 error = idle_connection_state_lifetime_seconds_.ProcessPeerHello(
655 peer_hello, hello_type, error_details); 650 peer_hello, hello_type, error_details);
656 } 651 }
657 if (error == QUIC_NO_ERROR) { 652 if (error == QUIC_NO_ERROR) {
658 error = 653 error =
659 silent_close_.ProcessPeerHello(peer_hello, hello_type, error_details); 654 silent_close_.ProcessPeerHello(peer_hello, hello_type, error_details);
660 } 655 }
661 if (error == QUIC_NO_ERROR) { 656 if (error == QUIC_NO_ERROR) {
662 error = max_streams_per_connection_.ProcessPeerHello( 657 error = max_streams_per_connection_.ProcessPeerHello(
663 peer_hello, hello_type, error_details); 658 peer_hello, hello_type, error_details);
(...skipping 19 matching lines...) Expand all
683 peer_hello, hello_type, error_details); 678 peer_hello, hello_type, error_details);
684 } 679 }
685 if (error == QUIC_NO_ERROR) { 680 if (error == QUIC_NO_ERROR) {
686 error = connection_options_.ProcessPeerHello( 681 error = connection_options_.ProcessPeerHello(
687 peer_hello, hello_type, error_details); 682 peer_hello, hello_type, error_details);
688 } 683 }
689 return error; 684 return error;
690 } 685 }
691 686
692 } // namespace net 687 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/test_tools/quic_config_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698