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

Side by Side Diff: net/quic/quic_framer.cc

Issue 1415743010: Removing quic_allow_oversized_packets_for_test by generating and writing packets without a QuicConn… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106389203
Patch Set: Created 5 years, 1 month 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/quic_connection.cc ('k') | net/quic/test_tools/quic_connection_peer.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/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/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 297 }
298 bool can_truncate = 298 bool can_truncate =
299 frame.type == ACK_FRAME && 299 frame.type == ACK_FRAME &&
300 free_bytes >= GetMinAckFrameSize(PACKET_6BYTE_PACKET_NUMBER); 300 free_bytes >= GetMinAckFrameSize(PACKET_6BYTE_PACKET_NUMBER);
301 if (can_truncate) { 301 if (can_truncate) {
302 // Truncate the frame so the packet will not exceed kMaxPacketSize. 302 // Truncate the frame so the packet will not exceed kMaxPacketSize.
303 // Note that we may not use every byte of the writer in this case. 303 // Note that we may not use every byte of the writer in this case.
304 DVLOG(1) << "Truncating large frame, free bytes: " << free_bytes; 304 DVLOG(1) << "Truncating large frame, free bytes: " << free_bytes;
305 return free_bytes; 305 return free_bytes;
306 } 306 }
307 if (!FLAGS_quic_allow_oversized_packets_for_test) { 307 return 0;
308 return 0;
309 }
310 LOG(DFATAL) << "Packet size too small to fit frame.";
311 return frame_len;
312 } 308 }
313 309
314 QuicFramer::AckFrameInfo::AckFrameInfo() : max_delta(0) {} 310 QuicFramer::AckFrameInfo::AckFrameInfo() : max_delta(0) {}
315 311
316 QuicFramer::AckFrameInfo::~AckFrameInfo() {} 312 QuicFramer::AckFrameInfo::~AckFrameInfo() {}
317 313
318 // static 314 // static
319 QuicPacketEntropyHash QuicFramer::GetPacketEntropyHash( 315 QuicPacketEntropyHash QuicFramer::GetPacketEntropyHash(
320 const QuicPacketHeader& header) { 316 const QuicPacketHeader& header) {
321 return header.entropy_flag << (header.packet_number % 8); 317 return header.entropy_flag << (header.packet_number % 8);
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 2192
2197 bool QuicFramer::RaiseError(QuicErrorCode error) { 2193 bool QuicFramer::RaiseError(QuicErrorCode error) {
2198 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) 2194 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error)
2199 << " detail: " << detailed_error_; 2195 << " detail: " << detailed_error_;
2200 set_error(error); 2196 set_error(error);
2201 visitor_->OnError(this); 2197 visitor_->OnError(this);
2202 return false; 2198 return false;
2203 } 2199 }
2204 2200
2205 } // namespace net 2201 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/test_tools/quic_connection_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698