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

Unified Diff: net/quic/quic_connection_logger.cc

Issue 549433006: Fix the logic for computing the number of truncated QUIC ACK frames sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection_logger.cc
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index 8157848fff62ff06eba358da203057cf82aa70b8..a16b2c562ddedc9933969e9f47953a40d4a2317c 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -367,13 +367,25 @@ void QuicConnectionLogger::OnFrameAddedToPacket(const QuicFrame& frame) {
NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_SENT,
base::Bind(&NetLogQuicStreamFrameCallback, frame.stream_frame));
break;
- case ACK_FRAME:
+ case ACK_FRAME: {
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_ACK_FRAME_SENT,
base::Bind(&NetLogQuicAckFrameCallback, frame.ack_frame));
- if (frame.ack_frame->is_truncated)
+ size_t num_ranges = 0;
+ QuicPacketSequenceNumber last_missing = 0;
+ for (SequenceNumberSet::const_iterator it =
+ frame.ack_frame->missing_packets.begin();
+ it != frame.ack_frame->missing_packets.end();
+ ++it) {
+ if (*it != last_missing + 1) {
eroman 2014/09/09 00:08:01 possibility of integer overflow?
Ryan Hamilton 2014/09/09 19:00:36 I guess it's *possible*, but since I'm using != an
+ ++num_ranges;
+ }
+ last_missing = *it;
+ }
+ if (num_ranges >= std::numeric_limits<uint8>::max())
eroman 2014/09/09 00:08:01 is it necessary to iterate everything if this is t
Ryan Hamilton 2014/09/09 19:00:36 as far as I know, but I'd be happy to come up with
eroman 2014/09/09 22:35:18 What I mean is that the "if" could be moved inside
Ryan Hamilton 2014/09/12 19:34:08 Done.
++num_truncated_acks_sent_;
break;
+ }
eroman 2014/09/09 00:08:01 How clever does this algorithm need to be? (How of
Ryan Hamilton 2014/09/09 19:00:36 Good question. We run it for computing data for hi
eroman 2014/09/09 22:35:18 Checking on size alone is another short cuircuit.
Ryan Hamilton 2014/09/12 19:34:08 Gotcha. I think I've implemented basically what yo
case CONGESTION_FEEDBACK_FRAME:
net_log_.AddEvent(
NetLog::TYPE_QUIC_SESSION_CONGESTION_FEEDBACK_FRAME_SENT,

Powered by Google App Engine
This is Rietveld 408576698