| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tools/quic/stateless_rejector.h" | 5 #include "net/tools/quic/stateless_rejector.h" |
| 6 | 6 |
| 7 #include "net/quic/core/quic_bug_tracker.h" | 7 #include "net/quic/core/quic_bug_tracker.h" |
| 8 #include "net/quic/core/quic_crypto_server_stream.h" | 8 #include "net/quic/core/quic_crypto_server_stream.h" |
| 9 #include "net/quic/core/quic_flags.h" | 9 #include "net/quic/core/quic_flags.h" |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void StatelessRejector::OnChlo(QuicVersion version, | 63 void StatelessRejector::OnChlo(QuicVersion version, |
| 64 QuicConnectionId connection_id, | 64 QuicConnectionId connection_id, |
| 65 QuicConnectionId server_designated_connection_id, | 65 QuicConnectionId server_designated_connection_id, |
| 66 const CryptoHandshakeMessage& message) { | 66 const CryptoHandshakeMessage& message) { |
| 67 DCHECK_EQ(kCHLO, message.tag()); | 67 DCHECK_EQ(kCHLO, message.tag()); |
| 68 DCHECK_NE(connection_id, server_designated_connection_id); | 68 DCHECK_NE(connection_id, server_designated_connection_id); |
| 69 DCHECK_EQ(state_, UNKNOWN); | 69 DCHECK_EQ(state_, UNKNOWN); |
| 70 | 70 |
| 71 if (!FLAGS_enable_quic_stateless_reject_support || | 71 if (!FLAGS_enable_quic_stateless_reject_support || |
| 72 !FLAGS_quic_use_cheap_stateless_rejects || | 72 !FLAGS_quic_use_cheap_stateless_rejects || |
| 73 !QuicCryptoServerStream::DoesPeerSupportStatelessRejects(message) || | 73 !QuicCryptoServerStream::DoesPeerSupportStatelessRejects(message)) { |
| 74 version <= QUIC_VERSION_32) { | |
| 75 state_ = UNSUPPORTED; | 74 state_ = UNSUPPORTED; |
| 76 return; | 75 return; |
| 77 } | 76 } |
| 78 | 77 |
| 79 connection_id_ = connection_id; | 78 connection_id_ = connection_id; |
| 80 server_designated_connection_id_ = server_designated_connection_id; | 79 server_designated_connection_id_ = server_designated_connection_id; |
| 81 chlo_ = message; // Note: copies the message | 80 chlo_ = message; // Note: copies the message |
| 82 } | 81 } |
| 83 | 82 |
| 84 void StatelessRejector::Process(std::unique_ptr<StatelessRejector> rejector, | 83 void StatelessRejector::Process(std::unique_ptr<StatelessRejector> rejector, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 state_ = FAILED; | 149 state_ = FAILED; |
| 151 } else if (reply_->tag() == kSREJ) { | 150 } else if (reply_->tag() == kSREJ) { |
| 152 state_ = REJECTED; | 151 state_ = REJECTED; |
| 153 } else { | 152 } else { |
| 154 state_ = ACCEPTED; | 153 state_ = ACCEPTED; |
| 155 } | 154 } |
| 156 done_cb->Run(std::move(rejector)); | 155 done_cb->Run(std::move(rejector)); |
| 157 } | 156 } |
| 158 | 157 |
| 159 } // namespace net | 158 } // namespace net |
| OLD | NEW |