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

Unified Diff: net/quic/core/quic_connection.cc

Issue 2515613002: deprecate FLAGS_quic_disable_pre_34 (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « net/quic/core/quic_connection.h ('k') | net/quic/core/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection.cc
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc
index b4b351d660c7787cd03f1bf78aa09258e20e4503..da418fa0d9a6b6c496f234cfadd401a5a5819356 100644
--- a/net/quic/core/quic_connection.cc
+++ b/net/quic/core/quic_connection.cc
@@ -256,7 +256,6 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
debug_visitor_(nullptr),
packet_generator_(connection_id_,
&framer_,
- random_generator_,
helper->GetBufferAllocator(),
this),
idle_network_timeout_(QuicTime::Delta::Infinite()),
@@ -289,7 +288,6 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
DVLOG(1) << ENDPOINT
<< "Created connection with connection_id: " << connection_id;
framer_.set_visitor(this);
- framer_.set_received_entropy_calculator(&received_packet_manager_);
if (!FLAGS_quic_receive_packet_once_decrypted) {
last_stop_waiting_frame_.least_unacked = 0;
}
@@ -306,7 +304,6 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
SetMaxPacketLength(perspective_ == Perspective::IS_SERVER
? kDefaultServerMaxPacketSize
: kDefaultMaxPacketSize);
- received_packet_manager_.SetVersion(version());
}
QuicConnection::~QuicConnection() {
@@ -500,7 +497,6 @@ bool QuicConnection::OnProtocolVersionMismatch(QuicVersion received_version) {
}
version_negotiation_state_ = NEGOTIATED_VERSION;
- received_packet_manager_.SetVersion(received_version);
visitor_->OnSuccessfulVersionNegotiation(received_version);
if (debug_visitor_ != nullptr) {
debug_visitor_->OnSuccessfulVersionNegotiation(received_version);
@@ -563,7 +559,6 @@ void QuicConnection::OnVersionNegotiationPacket(
DVLOG(1) << ENDPOINT
<< "Negotiated version: " << QuicVersionToString(version());
- received_packet_manager_.SetVersion(version());
server_supported_versions_ = packet.versions;
version_negotiation_state_ = NEGOTIATION_IN_PROGRESS;
RetransmitUnackedPackets(ALL_UNACKED_RETRANSMISSION);
@@ -732,9 +727,6 @@ bool QuicConnection::OnAckFrame(const QuicAckFrame& incoming_ack) {
send_alarm_->Cancel();
}
ProcessAckFrame(incoming_ack);
- if (incoming_ack.is_truncated) {
- should_last_packet_instigate_acks_ = true;
- }
// If the incoming ack's packets set expresses missing packets: peer is still
// waiting for a packet lower than a packet that we are no longer planning to
// send.
@@ -755,12 +747,6 @@ void QuicConnection::ProcessAckFrame(const QuicAckFrame& incoming_ack) {
largest_seen_packet_with_ack_ = last_header_.packet_number;
sent_packet_manager_->OnIncomingAck(incoming_ack,
time_of_last_received_packet_);
- if (version() <= QUIC_VERSION_33) {
- sent_entropy_manager_.ClearEntropyBefore(
- sent_packet_manager_->GetLeastPacketAwaitedByPeer(
- incoming_ack.path_id) -
- 1);
- }
// Always reset the retransmission alarm when an ack comes in, since we now
// have a better estimate of the current rtt than when it was set.
SetRetransmissionAlarm();
@@ -838,44 +824,13 @@ const char* QuicConnection::ValidateAckFrame(const QuicAckFrame& incoming_ack) {
return "Largest observed too low.";
}
- if (version() <= QUIC_VERSION_33) {
- if (!incoming_ack.packets.Empty() &&
- incoming_ack.packets.Max() > incoming_ack.largest_observed) {
- LOG(WARNING) << ENDPOINT
- << "Peer sent missing packet: " << incoming_ack.packets.Max()
- << " which is greater than largest observed: "
- << incoming_ack.largest_observed;
- return "Missing packet higher than largest observed.";
- }
-
- if (!incoming_ack.packets.Empty() &&
- incoming_ack.packets.Min() <
- sent_packet_manager_->GetLeastPacketAwaitedByPeer(
- incoming_ack.path_id)) {
- LOG(WARNING) << ENDPOINT
- << "Peer sent missing packet: " << incoming_ack.packets.Min()
- << " which is smaller than least_packet_awaited_by_peer_: "
- << sent_packet_manager_->GetLeastPacketAwaitedByPeer(
- incoming_ack.path_id);
- return "Missing packet smaller than least awaited.";
- }
- if (!sent_entropy_manager_.IsValidEntropy(incoming_ack.largest_observed,
- incoming_ack.packets,
- incoming_ack.entropy_hash)) {
- DLOG(WARNING) << ENDPOINT << "Peer sent invalid entropy."
- << " largest_observed:" << incoming_ack.largest_observed
- << " last_received:" << last_header_.packet_number;
- return "Invalid entropy.";
- }
- } else {
- if (!incoming_ack.packets.Empty() &&
- incoming_ack.packets.Max() != incoming_ack.largest_observed) {
- QUIC_BUG << ENDPOINT
- << "Peer last received packet: " << incoming_ack.packets.Max()
- << " which is not equal to largest observed: "
- << incoming_ack.largest_observed;
- return "Last received packet not equal to largest observed.";
- }
+ if (!incoming_ack.packets.Empty() &&
+ incoming_ack.packets.Max() != incoming_ack.largest_observed) {
+ QUIC_BUG << ENDPOINT
+ << "Peer last received packet: " << incoming_ack.packets.Max()
+ << " which is not equal to largest observed: "
+ << incoming_ack.largest_observed;
+ return "Last received packet not equal to largest observed.";
}
return nullptr;
@@ -1039,7 +994,6 @@ void QuicConnection::OnPacketComplete() {
}
ClearLastFrames();
- MaybeCloseIfTooManyOutstandingPackets();
}
void QuicConnection::MaybeQueueAck(bool was_missing) {
@@ -1113,30 +1067,6 @@ void QuicConnection::ClearLastFrames() {
}
}
-void QuicConnection::MaybeCloseIfTooManyOutstandingPackets() {
- if (version() > QUIC_VERSION_33) {
- return;
- }
- // This occurs if we don't discard old packets we've sent fast enough.
- // It's possible largest observed is less than least unacked.
- if (sent_packet_manager_->GetLargestObserved(last_header_.path_id) >
- (sent_packet_manager_->GetLeastUnacked(last_header_.path_id) +
- kMaxTrackedPackets)) {
- CloseConnection(
- QUIC_TOO_MANY_OUTSTANDING_SENT_PACKETS,
- StringPrintf("More than %" PRIu64 " outstanding.", kMaxTrackedPackets),
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- }
- // This occurs if there are received packet gaps and the peer does not raise
- // the least unacked fast enough.
- if (received_packet_manager_.NumTrackedPackets() > kMaxTrackedPackets) {
- CloseConnection(
- QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS,
- StringPrintf("More than %" PRIu64 " outstanding.", kMaxTrackedPackets),
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- }
-}
-
const QuicFrame QuicConnection::GetUpdatedAckFrame() {
return received_packet_manager_.GetUpdatedAckFrame(clock_->ApproximateNow());
}
@@ -1144,10 +1074,6 @@ const QuicFrame QuicConnection::GetUpdatedAckFrame() {
void QuicConnection::PopulateStopWaitingFrame(
QuicStopWaitingFrame* stop_waiting) {
stop_waiting->least_unacked = GetLeastUnacked(stop_waiting->path_id);
- if (version() <= QUIC_VERSION_33) {
- stop_waiting->entropy_hash = sent_entropy_manager_.GetCumulativeEntropy(
- stop_waiting->least_unacked - 1);
- }
}
QuicPacketNumber QuicConnection::GetLeastUnacked(QuicPathId path_id) const {
@@ -1480,7 +1406,6 @@ bool QuicConnection::ProcessValidatedPacket(const QuicPacketHeader& header) {
DCHECK_EQ(1u, header.public_header.versions.size());
DCHECK_EQ(header.public_header.versions[0], version());
version_negotiation_state_ = NEGOTIATED_VERSION;
- received_packet_manager_.SetVersion(version());
visitor_->OnSuccessfulVersionNegotiation(version());
if (debug_visitor_ != nullptr) {
debug_visitor_->OnSuccessfulVersionNegotiation(version());
@@ -1492,7 +1417,6 @@ bool QuicConnection::ProcessValidatedPacket(const QuicPacketHeader& header) {
// it should stop sending version since the version negotiation is done.
packet_generator_.StopSendingVersion();
version_negotiation_state_ = NEGOTIATED_VERSION;
- received_packet_manager_.SetVersion(version());
visitor_->OnSuccessfulVersionNegotiation(version());
if (debug_visitor_ != nullptr) {
debug_visitor_->OnSuccessfulVersionNegotiation(version());
@@ -1877,10 +1801,6 @@ void QuicConnection::SendOrQueuePacket(SerializedPacket* packet) {
QUIC_BUG << "packet.encrypted_buffer == nullptr in to SendOrQueuePacket";
return;
}
- if (version() <= QUIC_VERSION_33) {
- sent_entropy_manager_.RecordPacketEntropyHash(packet->packet_number,
- packet->entropy_hash);
- }
// If there are already queued packets, queue this one immediately to ensure
// it's written in sequence number order.
if (!queued_packets_.empty() || !WritePacket(packet)) {
« no previous file with comments | « net/quic/core/quic_connection.h ('k') | net/quic/core/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698