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

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

Issue 1248683002: Revert of relnote: Protect against a QUIC crash bug but logging a DFATAL and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | net/quic/quic_packet_generator.cc » ('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_packet_creator.h" 5 #include "net/quic/quic_packet_creator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // packet sizes are properly used. 456 // packet sizes are properly used.
457 scoped_ptr<char[]> large_buffer; 457 scoped_ptr<char[]> large_buffer;
458 if (packet_size_ <= kMaxPacketSize) { 458 if (packet_size_ <= kMaxPacketSize) {
459 packet.reset( 459 packet.reset(
460 framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_)); 460 framer_->BuildDataPacket(header, queued_frames_, buffer, packet_size_));
461 } else { 461 } else {
462 large_buffer.reset(new char[packet_size_]); 462 large_buffer.reset(new char[packet_size_]);
463 packet.reset(framer_->BuildDataPacket(header, queued_frames_, 463 packet.reset(framer_->BuildDataPacket(header, queued_frames_,
464 large_buffer.get(), packet_size_)); 464 large_buffer.get(), packet_size_));
465 } 465 }
466 if (packet == nullptr) { 466 LOG_IF(DFATAL, packet == nullptr) << "Failed to serialize "
467 LOG(DFATAL) << "Failed to serialize " << queued_frames_.size() 467 << queued_frames_.size() << " frames.";
468 << " frames.";
469 return NoPacket();
470 }
471 468
472 OnBuiltFecProtectedPayload(header, packet->FecProtectedData()); 469 OnBuiltFecProtectedPayload(header, packet->FecProtectedData());
473 470
474 // Because of possible truncation, we can't be confident that our 471 // Because of possible truncation, we can't be confident that our
475 // packet size calculation worked correctly. 472 // packet size calculation worked correctly.
476 if (!possibly_truncated_by_length) { 473 if (!possibly_truncated_by_length) {
477 DCHECK_EQ(packet_size_, packet->length()); 474 DCHECK_EQ(packet_size_, packet->length());
478 } 475 }
479 // Immediately encrypt the packet, to ensure we don't encrypt the same packet 476 // Immediately encrypt the packet, to ensure we don't encrypt the same packet
480 // sequence number multiple times. 477 // sequence number multiple times.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 // Don't pad full packets. 625 // Don't pad full packets.
629 return; 626 return;
630 } 627 }
631 628
632 QuicPaddingFrame padding; 629 QuicPaddingFrame padding;
633 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr); 630 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr);
634 DCHECK(success); 631 DCHECK(success);
635 } 632 }
636 633
637 } // namespace net 634 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698