Chromium Code Reviews| 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 "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
| 10 #include "net/quic/crypto/crypto_handshake_message.h" | 10 #include "net/quic/crypto/crypto_handshake_message.h" |
| 11 #include "net/quic/crypto/crypto_protocol.h" | 11 #include "net/quic/crypto/crypto_protocol.h" |
| 12 #include "net/quic/crypto/quic_decrypter.h" | 12 #include "net/quic/crypto/quic_decrypter.h" |
| 13 #include "net/quic/crypto/quic_encrypter.h" | 13 #include "net/quic/crypto/quic_encrypter.h" |
| 14 #include "net/quic/quic_data_reader.h" | 14 #include "net/quic/quic_data_reader.h" |
| 15 #include "net/quic/quic_data_writer.h" | 15 #include "net/quic/quic_data_writer.h" |
| 16 #include "net/quic/quic_flags.h" | 16 #include "net/quic/quic_flags.h" |
| 17 #include "net/quic/quic_socket_address_coder.h" | 17 #include "net/quic/quic_socket_address_coder.h" |
| 18 #include "net/quic/quic_utils.h" | |
| 18 | 19 |
| 19 using base::StringPiece; | 20 using base::StringPiece; |
| 20 using std::map; | 21 using std::map; |
| 21 using std::max; | 22 using std::max; |
| 22 using std::min; | 23 using std::min; |
| 23 using std::numeric_limits; | 24 using std::numeric_limits; |
| 24 using std::string; | 25 using std::string; |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 | 28 |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 738 } | 739 } |
| 739 if (!writer->WriteUInt64(header.public_header.connection_id)) { | 740 if (!writer->WriteUInt64(header.public_header.connection_id)) { |
| 740 return false; | 741 return false; |
| 741 } | 742 } |
| 742 break; | 743 break; |
| 743 } | 744 } |
| 744 last_serialized_connection_id_ = header.public_header.connection_id; | 745 last_serialized_connection_id_ = header.public_header.connection_id; |
| 745 | 746 |
| 746 if (header.public_header.version_flag) { | 747 if (header.public_header.version_flag) { |
| 747 DCHECK_EQ(Perspective::IS_CLIENT, perspective_); | 748 DCHECK_EQ(Perspective::IS_CLIENT, perspective_); |
| 748 writer->WriteUInt32(QuicVersionToQuicTag(quic_version_)); | 749 QuicTag tag = QuicVersionToQuicTag(quic_version_); |
| 750 writer->WriteUInt32(tag); | |
| 751 DVLOG(1) << "version = " << quic_version_ | |
| 752 << ", tag = '" << QuicUtils::TagToString(tag) << "'"; | |
|
ramant (doing other things)
2015/03/28 13:56:56
nit: indentation on line 752.
| |
| 749 } | 753 } |
| 750 | 754 |
| 751 if (!AppendPacketSequenceNumber(header.public_header.sequence_number_length, | 755 if (!AppendPacketSequenceNumber(header.public_header.sequence_number_length, |
| 752 header.packet_sequence_number, writer)) { | 756 header.packet_sequence_number, writer)) { |
| 753 return false; | 757 return false; |
| 754 } | 758 } |
| 755 | 759 |
| 756 uint8 private_flags = 0; | 760 uint8 private_flags = 0; |
| 757 if (header.entropy_flag) { | 761 if (header.entropy_flag) { |
| 758 private_flags |= PACKET_PRIVATE_FLAGS_ENTROPY; | 762 private_flags |= PACKET_PRIVATE_FLAGS_ENTROPY; |
| (...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2207 | 2211 |
| 2208 bool QuicFramer::RaiseError(QuicErrorCode error) { | 2212 bool QuicFramer::RaiseError(QuicErrorCode error) { |
| 2209 DVLOG(1) << "Error detail: " << detailed_error_; | 2213 DVLOG(1) << "Error detail: " << detailed_error_; |
| 2210 set_error(error); | 2214 set_error(error); |
| 2211 visitor_->OnError(this); | 2215 visitor_->OnError(this); |
| 2212 reader_.reset(nullptr); | 2216 reader_.reset(nullptr); |
| 2213 return false; | 2217 return false; |
| 2214 } | 2218 } |
| 2215 | 2219 |
| 2216 } // namespace net | 2220 } // namespace net |
| OLD | NEW |