| 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/quic_framer.h" | 5 #include "net/quic/quic_framer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 // static | 436 // static |
| 437 QuicEncryptedPacket* QuicFramer::BuildPublicResetPacket( | 437 QuicEncryptedPacket* QuicFramer::BuildPublicResetPacket( |
| 438 const QuicPublicResetPacket& packet) { | 438 const QuicPublicResetPacket& packet) { |
| 439 DCHECK(packet.public_header.reset_flag); | 439 DCHECK(packet.public_header.reset_flag); |
| 440 | 440 |
| 441 CryptoHandshakeMessage reset; | 441 CryptoHandshakeMessage reset; |
| 442 reset.set_tag(kPRST); | 442 reset.set_tag(kPRST); |
| 443 reset.SetValue(kRNON, packet.nonce_proof); | 443 reset.SetValue(kRNON, packet.nonce_proof); |
| 444 reset.SetValue(kRSEQ, packet.rejected_packet_number); | 444 reset.SetValue(kRSEQ, packet.rejected_packet_number); |
| 445 if (!packet.client_address.address().empty()) { | 445 if (!packet.client_address.address_number().empty()) { |
| 446 // packet.client_address is non-empty. | 446 // packet.client_address is non-empty. |
| 447 QuicSocketAddressCoder address_coder(packet.client_address); | 447 QuicSocketAddressCoder address_coder(packet.client_address); |
| 448 string serialized_address = address_coder.Encode(); | 448 string serialized_address = address_coder.Encode(); |
| 449 if (serialized_address.empty()) { | 449 if (serialized_address.empty()) { |
| 450 return nullptr; | 450 return nullptr; |
| 451 } | 451 } |
| 452 reset.SetStringPiece(kCADR, serialized_address); | 452 reset.SetStringPiece(kCADR, serialized_address); |
| 453 } | 453 } |
| 454 const QuicData& reset_serialized = reset.GetSerialized(); | 454 const QuicData& reset_serialized = reset.GetSerialized(); |
| 455 | 455 |
| (...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 | 2260 |
| 2261 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2261 bool QuicFramer::RaiseError(QuicErrorCode error) { |
| 2262 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) | 2262 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) |
| 2263 << " detail: " << detailed_error_; | 2263 << " detail: " << detailed_error_; |
| 2264 set_error(error); | 2264 set_error(error); |
| 2265 visitor_->OnError(this); | 2265 visitor_->OnError(this); |
| 2266 return false; | 2266 return false; |
| 2267 } | 2267 } |
| 2268 | 2268 |
| 2269 } // namespace net | 2269 } // namespace net |
| OLD | NEW |