| 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 use_tagging_decrypter_(false), | 259 use_tagging_decrypter_(false), |
| 260 packets_write_attempts_(0), | 260 packets_write_attempts_(0), |
| 261 clock_(clock), | 261 clock_(clock), |
| 262 write_pause_time_delta_(QuicTime::Delta::Zero()), | 262 write_pause_time_delta_(QuicTime::Delta::Zero()), |
| 263 max_packet_size_(kMaxPacketSize) {} | 263 max_packet_size_(kMaxPacketSize) {} |
| 264 | 264 |
| 265 // QuicPacketWriter interface | 265 // QuicPacketWriter interface |
| 266 WriteResult WritePacket(const char* buffer, | 266 WriteResult WritePacket(const char* buffer, |
| 267 size_t buf_len, | 267 size_t buf_len, |
| 268 const IPAddressNumber& self_address, | 268 const IPAddressNumber& self_address, |
| 269 const IPEndPoint& peer_address) override { | 269 const IPEndPoint& peer_address, |
| 270 PerPacketOptions* options) override { |
| 270 QuicEncryptedPacket packet(buffer, buf_len); | 271 QuicEncryptedPacket packet(buffer, buf_len); |
| 271 ++packets_write_attempts_; | 272 ++packets_write_attempts_; |
| 272 | 273 |
| 273 if (packet.length() >= sizeof(final_bytes_of_last_packet_)) { | 274 if (packet.length() >= sizeof(final_bytes_of_last_packet_)) { |
| 274 final_bytes_of_previous_packet_ = final_bytes_of_last_packet_; | 275 final_bytes_of_previous_packet_ = final_bytes_of_last_packet_; |
| 275 memcpy(&final_bytes_of_last_packet_, packet.data() + packet.length() - 4, | 276 memcpy(&final_bytes_of_last_packet_, packet.data() + packet.length() - 4, |
| 276 sizeof(final_bytes_of_last_packet_)); | 277 sizeof(final_bytes_of_last_packet_)); |
| 277 } | 278 } |
| 278 | 279 |
| 279 if (use_tagging_decrypter_) { | 280 if (use_tagging_decrypter_) { |
| (...skipping 5403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5683 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); | 5684 QuicStreamFrame stream_frame(1u, false, 0u, StringPiece()); |
| 5684 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)), | 5685 EXPECT_DFATAL(ProcessFramePacket(QuicFrame(&stream_frame)), |
| 5685 "Received a packet with multipath flag on when multipath is " | 5686 "Received a packet with multipath flag on when multipath is " |
| 5686 "not enabled."); | 5687 "not enabled."); |
| 5687 EXPECT_FALSE(connection_.connected()); | 5688 EXPECT_FALSE(connection_.connected()); |
| 5688 } | 5689 } |
| 5689 | 5690 |
| 5690 } // namespace | 5691 } // namespace |
| 5691 } // namespace test | 5692 } // namespace test |
| 5692 } // namespace net | 5693 } // namespace net |
| OLD | NEW |