Chromium Code Reviews| 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, |