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

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

Issue 1246793002: 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 LOG_IF(DFATAL, packet == nullptr) << "Failed to serialize " 466 if (packet == nullptr) {
467 << queued_frames_.size() << " frames."; 467 LOG(DFATAL) << "Failed to serialize " << queued_frames_.size()
468 << " frames.";
469 return NoPacket();
470 }
468 471
469 OnBuiltFecProtectedPayload(header, packet->FecProtectedData()); 472 OnBuiltFecProtectedPayload(header, packet->FecProtectedData());
470 473
471 // Because of possible truncation, we can't be confident that our 474 // Because of possible truncation, we can't be confident that our
472 // packet size calculation worked correctly. 475 // packet size calculation worked correctly.
473 if (!possibly_truncated_by_length) { 476 if (!possibly_truncated_by_length) {
474 DCHECK_EQ(packet_size_, packet->length()); 477 DCHECK_EQ(packet_size_, packet->length());
475 } 478 }
476 // Immediately encrypt the packet, to ensure we don't encrypt the same packet 479 // Immediately encrypt the packet, to ensure we don't encrypt the same packet
477 // sequence number multiple times. 480 // sequence number multiple times.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 // Don't pad full packets. 628 // Don't pad full packets.
626 return; 629 return;
627 } 630 }
628 631
629 QuicPaddingFrame padding; 632 QuicPaddingFrame padding;
630 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr); 633 bool success = AddFrame(QuicFrame(&padding), false, false, nullptr);
631 DCHECK(success); 634 DCHECK(success);
632 } 635 }
633 636
634 } // namespace net 637 } // 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