OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/core/quic_framer.h" | 5 #include "net/quic/core/quic_framer.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 404 } |
405 | 405 |
406 // static | 406 // static |
407 std::unique_ptr<QuicEncryptedPacket> QuicFramer::BuildPublicResetPacket( | 407 std::unique_ptr<QuicEncryptedPacket> QuicFramer::BuildPublicResetPacket( |
408 const QuicPublicResetPacket& packet) { | 408 const QuicPublicResetPacket& packet) { |
409 DCHECK(packet.public_header.reset_flag); | 409 DCHECK(packet.public_header.reset_flag); |
410 | 410 |
411 CryptoHandshakeMessage reset; | 411 CryptoHandshakeMessage reset; |
412 reset.set_tag(kPRST); | 412 reset.set_tag(kPRST); |
413 reset.SetValue(kRNON, packet.nonce_proof); | 413 reset.SetValue(kRNON, packet.nonce_proof); |
414 if (!FLAGS_quic_reloadable_flag_quic_remove_packet_number_from_public_reset) { | |
415 reset.SetValue(kRSEQ, packet.rejected_packet_number); | |
416 } | |
417 if (packet.client_address.host().address_family() != | 414 if (packet.client_address.host().address_family() != |
418 IpAddressFamily::IP_UNSPEC) { | 415 IpAddressFamily::IP_UNSPEC) { |
419 // packet.client_address is non-empty. | 416 // packet.client_address is non-empty. |
420 QuicSocketAddressCoder address_coder(packet.client_address); | 417 QuicSocketAddressCoder address_coder(packet.client_address); |
421 string serialized_address = address_coder.Encode(); | 418 string serialized_address = address_coder.Encode(); |
422 if (serialized_address.empty()) { | 419 if (serialized_address.empty()) { |
423 return nullptr; | 420 return nullptr; |
424 } | 421 } |
425 reset.SetStringPiece(kCADR, serialized_address); | 422 reset.SetStringPiece(kCADR, serialized_address); |
426 } | 423 } |
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 | 2155 |
2159 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2156 bool QuicFramer::RaiseError(QuicErrorCode error) { |
2160 QUIC_DLOG(INFO) << ENDPOINT << "Error: " << QuicErrorCodeToString(error) | 2157 QUIC_DLOG(INFO) << ENDPOINT << "Error: " << QuicErrorCodeToString(error) |
2161 << " detail: " << detailed_error_; | 2158 << " detail: " << detailed_error_; |
2162 set_error(error); | 2159 set_error(error); |
2163 visitor_->OnError(this); | 2160 visitor_->OnError(this); |
2164 return false; | 2161 return false; |
2165 } | 2162 } |
2166 | 2163 |
2167 } // namespace net | 2164 } // namespace net |
OLD | NEW |