Index: net/quic/quic_connection.cc |
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc |
index 0548c0cef4aee09f3510913939a1269f475af88e..5eb161842ae30c4b9e1b161aab1b9aab6e101ad6 100644 |
--- a/net/quic/quic_connection.cc |
+++ b/net/quic/quic_connection.cc |
@@ -549,13 +549,12 @@ bool QuicConnection::OnAckFrame(const QuicAckFrame& incoming_ack) { |
void QuicConnection::ProcessAckFrame(const QuicAckFrame& incoming_ack) { |
largest_seen_packet_with_ack_ = last_header_.packet_sequence_number; |
- received_packet_manager_.UpdatePacketInformationReceivedByPeer( |
- incoming_ack.received_info); |
+ received_packet_manager_.UpdatePacketInformationReceivedByPeer(incoming_ack); |
sent_entropy_manager_.ClearEntropyBefore( |
received_packet_manager_.least_packet_awaited_by_peer() - 1); |
- sent_packet_manager_.OnIncomingAck(incoming_ack.received_info, |
+ sent_packet_manager_.OnIncomingAck(incoming_ack, |
time_of_last_received_packet_); |
if (sent_packet_manager_.HasPendingRetransmissions()) { |
WriteIfNotBlocked(); |
@@ -620,57 +619,55 @@ bool QuicConnection::OnPingFrame(const QuicPingFrame& frame) { |
} |
bool QuicConnection::ValidateAckFrame(const QuicAckFrame& incoming_ack) { |
- if (incoming_ack.received_info.largest_observed > |
- packet_generator_.sequence_number()) { |
+ if (incoming_ack.largest_observed > packet_generator_.sequence_number()) { |
DLOG(ERROR) << ENDPOINT << "Peer's observed unsent packet:" |
- << incoming_ack.received_info.largest_observed << " vs " |
+ << incoming_ack.largest_observed << " vs " |
<< packet_generator_.sequence_number(); |
// We got an error for data we have not sent. Error out. |
return false; |
} |
- if (incoming_ack.received_info.largest_observed < |
+ if (incoming_ack.largest_observed < |
received_packet_manager_.peer_largest_observed_packet()) { |
DLOG(ERROR) << ENDPOINT << "Peer's largest_observed packet decreased:" |
- << incoming_ack.received_info.largest_observed << " vs " |
+ << incoming_ack.largest_observed << " vs " |
<< received_packet_manager_.peer_largest_observed_packet(); |
// A new ack has a diminished largest_observed value. Error out. |
// If this was an old packet, we wouldn't even have checked. |
return false; |
} |
- if (!incoming_ack.received_info.missing_packets.empty() && |
- *incoming_ack.received_info.missing_packets.rbegin() > |
- incoming_ack.received_info.largest_observed) { |
+ if (!incoming_ack.missing_packets.empty() && |
+ *incoming_ack.missing_packets.rbegin() > incoming_ack.largest_observed) { |
DLOG(ERROR) << ENDPOINT << "Peer sent missing packet: " |
- << *incoming_ack.received_info.missing_packets.rbegin() |
+ << *incoming_ack.missing_packets.rbegin() |
<< " which is greater than largest observed: " |
- << incoming_ack.received_info.largest_observed; |
+ << incoming_ack.largest_observed; |
return false; |
} |
- if (!incoming_ack.received_info.missing_packets.empty() && |
- *incoming_ack.received_info.missing_packets.begin() < |
+ if (!incoming_ack.missing_packets.empty() && |
+ *incoming_ack.missing_packets.begin() < |
received_packet_manager_.least_packet_awaited_by_peer()) { |
DLOG(ERROR) << ENDPOINT << "Peer sent missing packet: " |
- << *incoming_ack.received_info.missing_packets.begin() |
+ << *incoming_ack.missing_packets.begin() |
<< " which is smaller than least_packet_awaited_by_peer_: " |
<< received_packet_manager_.least_packet_awaited_by_peer(); |
return false; |
} |
if (!sent_entropy_manager_.IsValidEntropy( |
- incoming_ack.received_info.largest_observed, |
- incoming_ack.received_info.missing_packets, |
- incoming_ack.received_info.entropy_hash)) { |
+ incoming_ack.largest_observed, |
+ incoming_ack.missing_packets, |
+ incoming_ack.entropy_hash)) { |
DLOG(ERROR) << ENDPOINT << "Peer sent invalid entropy."; |
return false; |
} |
for (SequenceNumberSet::const_iterator iter = |
- incoming_ack.received_info.revived_packets.begin(); |
- iter != incoming_ack.received_info.revived_packets.end(); ++iter) { |
- if (!ContainsKey(incoming_ack.received_info.missing_packets, *iter)) { |
+ incoming_ack.revived_packets.begin(); |
+ iter != incoming_ack.revived_packets.end(); ++iter) { |
+ if (!ContainsKey(incoming_ack.missing_packets, *iter)) { |
DLOG(ERROR) << ENDPOINT |
<< "Peer specified revived packet which was not missing."; |
return false; |
@@ -895,7 +892,7 @@ void QuicConnection::ClearLastFrames() { |
QuicAckFrame* QuicConnection::CreateAckFrame() { |
QuicAckFrame* outgoing_ack = new QuicAckFrame(); |
received_packet_manager_.UpdateReceivedPacketInfo( |
- &(outgoing_ack->received_info), clock_->ApproximateNow()); |
+ outgoing_ack, clock_->ApproximateNow()); |
DVLOG(1) << ENDPOINT << "Creating ack frame: " << *outgoing_ack; |
return outgoing_ack; |
} |
@@ -919,8 +916,7 @@ bool QuicConnection::ShouldLastPacketInstigateAck() const { |
return true; |
} |
- if (!last_ack_frames_.empty() && |
- last_ack_frames_.back().received_info.is_truncated) { |
+ if (!last_ack_frames_.empty() && last_ack_frames_.back().is_truncated) { |
return true; |
} |
return false; |
@@ -933,9 +929,8 @@ void QuicConnection::UpdateStopWaitingCount() { |
// If the peer is still waiting for a packet that we are no longer planning to |
// send, send an ack to raise the high water mark. |
- if (!last_ack_frames_.back().received_info.missing_packets.empty() && |
- GetLeastUnacked() > |
- *last_ack_frames_.back().received_info.missing_packets.begin()) { |
+ if (!last_ack_frames_.back().missing_packets.empty() && |
+ GetLeastUnacked() > *last_ack_frames_.back().missing_packets.begin()) { |
++stop_waiting_count_; |
} else { |
stop_waiting_count_ = 0; |