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

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

Issue 1760973003: Reserve exactly enough space for QUIC timestamps in QuicAckFrame. received_packet_times. No functi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@115591067
Patch Set: Update dependency Created 4 years, 9 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 | no next file » | 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/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 if (ack_frame->is_truncated) { 1480 if (ack_frame->is_truncated) {
1481 return true; 1481 return true;
1482 } 1482 }
1483 uint8_t num_received_packets; 1483 uint8_t num_received_packets;
1484 if (!reader->ReadBytes(&num_received_packets, 1)) { 1484 if (!reader->ReadBytes(&num_received_packets, 1)) {
1485 set_detailed_error("Unable to read num received packets."); 1485 set_detailed_error("Unable to read num received packets.");
1486 return false; 1486 return false;
1487 } 1487 }
1488 1488
1489 if (num_received_packets > 0) { 1489 if (num_received_packets > 0) {
1490 ack_frame->received_packet_times.reserve(num_received_packets);
1490 uint8_t delta_from_largest_observed; 1491 uint8_t delta_from_largest_observed;
1491 if (!reader->ReadBytes(&delta_from_largest_observed, 1492 if (!reader->ReadBytes(&delta_from_largest_observed,
1492 PACKET_1BYTE_PACKET_NUMBER)) { 1493 PACKET_1BYTE_PACKET_NUMBER)) {
1493 set_detailed_error("Unable to read sequence delta in received packets."); 1494 set_detailed_error("Unable to read sequence delta in received packets.");
1494 return false; 1495 return false;
1495 } 1496 }
1496 QuicPacketNumber seq_num = 1497 QuicPacketNumber seq_num =
1497 ack_frame->largest_observed - delta_from_largest_observed; 1498 ack_frame->largest_observed - delta_from_largest_observed;
1498 1499
1499 // Time delta from the framer creation. 1500 // Time delta from the framer creation.
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 2307
2307 bool QuicFramer::RaiseError(QuicErrorCode error) { 2308 bool QuicFramer::RaiseError(QuicErrorCode error) {
2308 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) 2309 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error)
2309 << " detail: " << detailed_error_; 2310 << " detail: " << detailed_error_;
2310 set_error(error); 2311 set_error(error);
2311 visitor_->OnError(this); 2312 visitor_->OnError(this);
2312 return false; 2313 return false;
2313 } 2314 }
2314 2315
2315 } // namespace net 2316 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698