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

Side by Side Diff: net/quic/core/quic_connection_test.cc

Issue 2901773004: Landing Recent QUIC changes until May 20, 2017. (Closed)
Patch Set: Disable quic_restart_flag_quic_big_endian_connection_id_server until tests can be fixed. Created 3 years, 6 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 | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.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) 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_connection.h" 5 #include "net/quic/core/quic_connection.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <memory> 8 #include <memory>
9 #include <ostream> 9 #include <ostream>
10 #include <utility> 10 #include <utility>
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 844
845 size_t ProcessFramePacketAtLevel(QuicPacketNumber number, 845 size_t ProcessFramePacketAtLevel(QuicPacketNumber number,
846 QuicFrame frame, 846 QuicFrame frame,
847 EncryptionLevel level) { 847 EncryptionLevel level) {
848 QuicPacketHeader header; 848 QuicPacketHeader header;
849 header.public_header.connection_id = 849 header.public_header.connection_id =
850 GetPeerInMemoryConnectionId(connection_id_); 850 GetPeerInMemoryConnectionId(connection_id_);
851 header.public_header.packet_number_length = packet_number_length_; 851 header.public_header.packet_number_length = packet_number_length_;
852 header.public_header.connection_id_length = connection_id_length_; 852 header.public_header.connection_id_length = connection_id_length_;
853 header.public_header.multipath_flag = false;
854 header.packet_number = number; 853 header.packet_number = number;
855 QuicFrames frames; 854 QuicFrames frames;
856 frames.push_back(frame); 855 frames.push_back(frame);
857 std::unique_ptr<QuicPacket> packet(ConstructPacket(header, frames)); 856 std::unique_ptr<QuicPacket> packet(ConstructPacket(header, frames));
858 857
859 char buffer[kMaxPacketSize]; 858 char buffer[kMaxPacketSize];
860 size_t encrypted_length = 859 size_t encrypted_length =
861 framer_.EncryptPayload(level, number, *packet, buffer, kMaxPacketSize); 860 framer_.EncryptPayload(level, number, *packet, buffer, kMaxPacketSize);
862 connection_.ProcessUdpPacket( 861 connection_.ProcessUdpPacket(
863 kSelfAddress, kPeerAddress, 862 kSelfAddress, kPeerAddress,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 955
957 QuicPacket* ConstructDataPacket(QuicPacketNumber number, 956 QuicPacket* ConstructDataPacket(QuicPacketNumber number,
958 bool has_stop_waiting) { 957 bool has_stop_waiting) {
959 QuicPacketHeader header; 958 QuicPacketHeader header;
960 // Set connection_id to peer's in memory representation as this data packet 959 // Set connection_id to peer's in memory representation as this data packet
961 // is created by peer_framer. 960 // is created by peer_framer.
962 header.public_header.connection_id = 961 header.public_header.connection_id =
963 GetPeerInMemoryConnectionId(connection_id_); 962 GetPeerInMemoryConnectionId(connection_id_);
964 header.public_header.packet_number_length = packet_number_length_; 963 header.public_header.packet_number_length = packet_number_length_;
965 header.public_header.connection_id_length = connection_id_length_; 964 header.public_header.connection_id_length = connection_id_length_;
966 header.public_header.multipath_flag = false;
967 header.packet_number = number; 965 header.packet_number = number;
968 966
969 QuicFrames frames; 967 QuicFrames frames;
970 frames.push_back(QuicFrame(&frame1_)); 968 frames.push_back(QuicFrame(&frame1_));
971 if (has_stop_waiting) { 969 if (has_stop_waiting) {
972 frames.push_back(QuicFrame(&stop_waiting_)); 970 frames.push_back(QuicFrame(&stop_waiting_));
973 } 971 }
974 return ConstructPacket(header, frames); 972 return ConstructPacket(header, frames);
975 } 973 }
976 974
(...skipping 4286 matching lines...) Expand 10 before | Expand all | Expand 10 after
5263 error_details, ConnectionCloseSource::FROM_PEER)); 5261 error_details, ConnectionCloseSource::FROM_PEER));
5264 connection_.set_perspective(Perspective::IS_CLIENT); 5262 connection_.set_perspective(Perspective::IS_CLIENT);
5265 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, 5263 connection_.CloseConnection(QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT,
5266 error_details, 5264 error_details,
5267 ConnectionCloseBehavior::SILENT_CLOSE); 5265 ConnectionCloseBehavior::SILENT_CLOSE);
5268 } 5266 }
5269 5267
5270 } // namespace 5268 } // namespace
5271 } // namespace test 5269 } // namespace test
5272 } // namespace net 5270 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_flags_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698