summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrtenneti <rtenneti@chromium.org>2015-03-02 22:36:50 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-03 06:37:36 +0000
commitae5ac43d4e570358d18b94e9007283078ee7c456 (patch)
treecf44aff521cae270ed43801bd3c0a74227b9b1a0
parent3f9cbd3ae7b8d2ac0c87aabbc03425d56d8a917b (diff)
downloadchromium_src-ae5ac43d4e570358d18b94e9007283078ee7c456.zip
chromium_src-ae5ac43d4e570358d18b94e9007283078ee7c456.tar.gz
chromium_src-ae5ac43d4e570358d18b94e9007283078ee7c456.tar.bz2
Land Recent QUIC Changes until 03/02/2015.
CL generated with data from dead-code analysis using .../scythe:remove_dead_code #codehealth Merge internal change: 87564533 https://codereview.chromium.org/973683003/ Change QUIC's PrrSender::TimeUntilSend to accept bytes instead of packets. No functional change. Merge internal change: 87535917 https://codereview.chromium.org/972033002/ Discard acks from QUIC's UnackedPacketMap when the map is larger than one half of its max size(2500). Was previously 200. Merge internal change: 87419283 https://codereview.chromium.org/977453002/ Remove TCP and BBR's max congestion window. No practical change, because Chrome's receive window is the limiting factor. Adds kMaxReportedCwnd and kMaxReorderingForRtt as constants to replace the max CWND in classes that used to rely on max CWND. Merge internal change: 87346681 https://codereview.chromium.org/968923005/ Minor simplification to QuicSentPacketManager::PendingRetransmission. No functional change. Merge internal change: 87254408 https://codereview.chromium.org/969153002/ Log the QUIC SRBF (socket receive buffer size) as an int instead of hex value. Merge internal change: 87247898 https://codereview.chromium.org/974593002/ Minimally test a few things to keep them from Scythe. test-only change. Merge internal change: 87171236 https://codereview.chromium.org/971493003/ Deprecate FLAGS_quic_limit_time_wait_list_size. Merge internal change: 87059868 https://codereview.chromium.org/968323002/ CL generated with data from dead-code analysis using .../scythe:remove_dead_code #codehealth Merge internal change: 86999211 https://codereview.chromium.org/974563002/ Remove unused ability to disable flow control in QUIC QuicFlowController::Disable() is no longer called. It was used when we disabled flow control for the headers and crypto streams, and for old versions which did not support connection level flow control. Now that we are on QUIC_VERSION_23, we now use flow control on all streams and all connections, so this is safe to remove. Thanks to tgreer@ for the scythe code removal in cl/86835556, and alyssar@ for noticing that the removal of the dead QuicFlowController:Disable() meant we could remove substantially more in this CL. Merge internal change: 86960342 https://codereview.chromium.org/969053004/ Remove unnecessary virtual CreateQuicConnection method. Merge internal change: 86947282 https://codereview.chromium.org/972783002/ R=rch@chromium.org Review URL: https://codereview.chromium.org/968233004 Cr-Commit-Position: refs/heads/master@{#318846}
-rw-r--r--net/quic/congestion_control/prr_sender.cc8
-rw-r--r--net/quic/congestion_control/prr_sender.h3
-rw-r--r--net/quic/congestion_control/prr_sender_test.cc18
-rw-r--r--net/quic/congestion_control/rtt_stats.h3
-rw-r--r--net/quic/congestion_control/send_algorithm_interface.cc8
-rw-r--r--net/quic/congestion_control/send_algorithm_simulator.cc5
-rw-r--r--net/quic/congestion_control/send_algorithm_simulator.h4
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender.cc38
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender.h7
-rw-r--r--net/quic/congestion_control/tcp_cubic_sender_test.cc87
-rw-r--r--net/quic/crypto/crypto_handshake_message.cc6
-rw-r--r--net/quic/crypto/crypto_handshake_message.h1
-rw-r--r--net/quic/crypto/crypto_protocol.h3
-rw-r--r--net/quic/quic_bandwidth_test.cc13
-rw-r--r--net/quic/quic_config.cc73
-rw-r--r--net/quic/quic_config.h35
-rw-r--r--net/quic/quic_connection.cc3
-rw-r--r--net/quic/quic_connection_test.cc19
-rw-r--r--net/quic/quic_crypto_client_stream.cc1
-rw-r--r--net/quic/quic_crypto_stream_test.cc1
-rw-r--r--net/quic/quic_data_reader.cc33
-rw-r--r--net/quic/quic_data_reader.h10
-rw-r--r--net/quic/quic_data_stream.cc7
-rw-r--r--net/quic/quic_data_stream.h4
-rw-r--r--net/quic/quic_data_writer.cc32
-rw-r--r--net/quic/quic_data_writer.h7
-rw-r--r--net/quic/quic_data_writer_test.cc24
-rw-r--r--net/quic/quic_dispatcher.cc25
-rw-r--r--net/quic/quic_dispatcher.h10
-rw-r--r--net/quic/quic_flags.cc4
-rw-r--r--net/quic/quic_flags.h1
-rw-r--r--net/quic/quic_flow_controller.cc39
-rw-r--r--net/quic/quic_flow_controller.h9
-rw-r--r--net/quic/quic_flow_controller_test.cc3
-rw-r--r--net/quic/quic_headers_stream_test.cc1
-rw-r--r--net/quic/quic_packet_creator.h4
-rw-r--r--net/quic/quic_protocol.h11
-rw-r--r--net/quic/quic_sent_packet_manager.cc14
-rw-r--r--net/quic/quic_sent_packet_manager.h2
-rw-r--r--net/quic/quic_server_id.h1
-rw-r--r--net/quic/quic_session.cc3
-rw-r--r--net/quic/quic_stream_sequencer_test.cc7
-rw-r--r--net/quic/quic_time.cc1
-rw-r--r--net/quic/quic_time_wait_list_manager.cc38
-rw-r--r--net/quic/quic_unacked_packet_map.cc2
-rw-r--r--net/quic/quic_unacked_packet_map_test.cc6
-rw-r--r--net/quic/quic_utils.cc14
-rw-r--r--net/quic/quic_utils.h5
-rw-r--r--net/quic/reliable_quic_stream.cc63
-rw-r--r--net/quic/reliable_quic_stream_test.cc4
-rw-r--r--net/quic/test_tools/quic_connection_peer.cc29
-rw-r--r--net/quic/test_tools/quic_connection_peer.h13
-rw-r--r--net/quic/test_tools/quic_sent_packet_manager_peer.cc14
-rw-r--r--net/quic/test_tools/quic_sent_packet_manager_peer.h7
-rw-r--r--net/quic/test_tools/quic_test_utils.h1
-rw-r--r--net/quic/test_tools/simple_quic_framer.cc4
-rw-r--r--net/quic/test_tools/simple_quic_framer.h1
-rw-r--r--net/tools/quic/quic_dispatcher.cc25
-rw-r--r--net/tools/quic/quic_dispatcher.h10
-rw-r--r--net/tools/quic/quic_packet_writer_wrapper.cc4
-rw-r--r--net/tools/quic/quic_packet_writer_wrapper.h3
-rw-r--r--net/tools/quic/quic_server.h4
-rw-r--r--net/tools/quic/quic_server_session_test.cc6
-rw-r--r--net/tools/quic/quic_time_wait_list_manager.cc38
-rw-r--r--net/tools/quic/quic_time_wait_list_manager_test.cc1
-rw-r--r--net/tools/quic/test_tools/packet_dropping_test_writer.h1
-rw-r--r--net/tools/quic/test_tools/quic_dispatcher_peer.cc11
-rw-r--r--net/tools/quic/test_tools/quic_dispatcher_peer.h6
68 files changed, 153 insertions, 745 deletions
diff --git a/net/quic/congestion_control/prr_sender.cc b/net/quic/congestion_control/prr_sender.cc
index 588a2fe..51b32d3 100644
--- a/net/quic/congestion_control/prr_sender.cc
+++ b/net/quic/congestion_control/prr_sender.cc
@@ -39,7 +39,7 @@ void PrrSender::OnPacketAcked(QuicByteCount acked_bytes) {
QuicTime::Delta PrrSender::TimeUntilSend(
QuicByteCount congestion_window,
QuicByteCount bytes_in_flight,
- QuicPacketCount slowstart_threshold) const {
+ QuicByteCount slowstart_threshold) const {
// Return QuicTime::Zero In order to ensure limited transmit always works.
if (bytes_sent_since_loss_ == 0 || bytes_in_flight < kMaxSegmentSize) {
return QuicTime::Delta::Zero();
@@ -50,7 +50,7 @@ QuicTime::Delta PrrSender::TimeUntilSend(
// when more packets are lost than the CWND reduction.
// limit = MAX(prr_delivered - prr_out, DeliveredData) + MSS
if (bytes_delivered_since_loss_ + ack_count_since_loss_ * kMaxSegmentSize <=
- bytes_sent_since_loss_) {
+ bytes_sent_since_loss_) {
return QuicTime::Delta::Infinite();
}
return QuicTime::Delta::Zero();
@@ -59,8 +59,8 @@ QuicTime::Delta PrrSender::TimeUntilSend(
// Checks a simplified version of the PRR formula that doesn't use division:
// AvailableSendWindow =
// CEIL(prr_delivered * ssthresh / BytesInFlightAtLoss) - prr_sent
- if (bytes_delivered_since_loss_ * slowstart_threshold * kMaxSegmentSize >
- bytes_sent_since_loss_ * bytes_in_flight_before_loss_) {
+ if (bytes_delivered_since_loss_ * slowstart_threshold >
+ bytes_sent_since_loss_ * bytes_in_flight_before_loss_) {
return QuicTime::Delta::Zero();
}
return QuicTime::Delta::Infinite();
diff --git a/net/quic/congestion_control/prr_sender.h b/net/quic/congestion_control/prr_sender.h
index 495943d..c783668 100644
--- a/net/quic/congestion_control/prr_sender.h
+++ b/net/quic/congestion_control/prr_sender.h
@@ -23,8 +23,7 @@ class NET_EXPORT_PRIVATE PrrSender {
void OnPacketAcked(QuicByteCount acked_bytes);
QuicTime::Delta TimeUntilSend(QuicByteCount congestion_window,
QuicByteCount bytes_in_flight,
- QuicPacketCount slowstart_threshold)
- const;
+ QuicByteCount slowstart_threshold) const;
private:
// Bytes sent and acked since the last loss event.
diff --git a/net/quic/congestion_control/prr_sender_test.cc b/net/quic/congestion_control/prr_sender_test.cc
index 7a42bd5..ed8397f 100644
--- a/net/quic/congestion_control/prr_sender_test.cc
+++ b/net/quic/congestion_control/prr_sender_test.cc
@@ -35,13 +35,13 @@ TEST_F(PrrSenderTest, SingleLossResultsInSendOnEveryOtherAck) {
bytes_in_flight -= kMaxSegmentSize;
EXPECT_EQ(QuicTime::Delta::Zero(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Send retransmission.
prr.OnPacketSent(kMaxSegmentSize);
// PRR shouldn't allow sending any more packets.
EXPECT_EQ(QuicTime::Delta::Infinite(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// One packet is lost, and one ack was consumed above. PRR now paces
// transmissions through the remaining 48 acks. PRR will alternatively
@@ -52,13 +52,13 @@ TEST_F(PrrSenderTest, SingleLossResultsInSendOnEveryOtherAck) {
bytes_in_flight -= kMaxSegmentSize;
EXPECT_EQ(QuicTime::Delta::Infinite(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Ack another packet. PRR should now allow sending a packet in response.
prr.OnPacketAcked(kMaxSegmentSize);
bytes_in_flight -= kMaxSegmentSize;
EXPECT_EQ(QuicTime::Delta::Zero(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Send a packet in response.
prr.OnPacketSent(kMaxSegmentSize);
bytes_in_flight += kMaxSegmentSize;
@@ -73,7 +73,7 @@ TEST_F(PrrSenderTest, SingleLossResultsInSendOnEveryOtherAck) {
bytes_in_flight -= kMaxSegmentSize;
EXPECT_EQ(QuicTime::Delta::Zero(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Send a packet in response, since PRR allows it.
prr.OnPacketSent(kMaxSegmentSize);
bytes_in_flight += kMaxSegmentSize;
@@ -83,7 +83,7 @@ TEST_F(PrrSenderTest, SingleLossResultsInSendOnEveryOtherAck) {
EXPECT_EQ(congestion_window, bytes_in_flight);
EXPECT_EQ(QuicTime::Delta::Infinite(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
}
}
@@ -106,7 +106,7 @@ TEST_F(PrrSenderTest, BurstLossResultsInSlowStart) {
for (int j = 0; j < 2; ++j) {
EXPECT_EQ(QuicTime::Delta::Zero(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Send a packet in response.
prr.OnPacketSent(kMaxSegmentSize);
bytes_in_flight += kMaxSegmentSize;
@@ -114,7 +114,7 @@ TEST_F(PrrSenderTest, BurstLossResultsInSlowStart) {
// PRR should allow no more than 2 packets in response to an ack.
EXPECT_EQ(QuicTime::Delta::Infinite(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
}
// Out of SSRB mode, PRR allows one send in response to each ack.
@@ -123,7 +123,7 @@ TEST_F(PrrSenderTest, BurstLossResultsInSlowStart) {
bytes_in_flight -= kMaxSegmentSize;
EXPECT_EQ(QuicTime::Delta::Zero(),
prr.TimeUntilSend(congestion_window, bytes_in_flight,
- ssthresh_after_loss));
+ ssthresh_after_loss * kMaxSegmentSize));
// Send a packet in response.
prr.OnPacketSent(kMaxSegmentSize);
bytes_in_flight += kMaxSegmentSize;
diff --git a/net/quic/congestion_control/rtt_stats.h b/net/quic/congestion_control/rtt_stats.h
index 3d256d9..a14cfcb 100644
--- a/net/quic/congestion_control/rtt_stats.h
+++ b/net/quic/congestion_control/rtt_stats.h
@@ -23,9 +23,6 @@ class NET_EXPORT_PRIVATE RttStats {
public:
RttStats();
- // Returns true if any RTT measurements have been made.
- bool HasUpdates() const;
-
// Updates the RTT from an incoming ack which is received |send_delta| after
// the packet is sent and the peer reports the ack being delayed |ack_delay|.
void UpdateRtt(QuicTime::Delta send_delta,
diff --git a/net/quic/congestion_control/send_algorithm_interface.cc b/net/quic/congestion_control/send_algorithm_interface.cc
index 82f1135..deeaf8c 100644
--- a/net/quic/congestion_control/send_algorithm_interface.cc
+++ b/net/quic/congestion_control/send_algorithm_interface.cc
@@ -21,17 +21,15 @@ SendAlgorithmInterface* SendAlgorithmInterface::Create(
switch (congestion_control_type) {
case kCubic:
return new TcpCubicSender(clock, rtt_stats, false /* don't use Reno */,
- initial_congestion_window,
- kMaxTcpCongestionWindow, stats);
+ initial_congestion_window, stats);
case kReno:
return new TcpCubicSender(clock, rtt_stats, true /* use Reno */,
- initial_congestion_window,
- kMaxTcpCongestionWindow, stats);
+ initial_congestion_window, stats);
case kBBR:
// TODO(rtenneti): Enable BbrTcpSender.
#if 0
return new BbrTcpSender(clock, rtt_stats, initial_congestion_window,
- kMaxTcpCongestionWindow, stats);
+ stats);
#endif
LOG(DFATAL) << "BbrTcpSender is not supported.";
return nullptr;
diff --git a/net/quic/congestion_control/send_algorithm_simulator.cc b/net/quic/congestion_control/send_algorithm_simulator.cc
index 3d6d456..64f0ee1 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.cc
+++ b/net/quic/congestion_control/send_algorithm_simulator.cc
@@ -387,9 +387,4 @@ void SendAlgorithmSimulator::SendDataNow(Transfer* transfer) {
transfer->bytes_in_flight += kPacketSize;
}
-// Advance the time by |delta| without sending anything.
-void SendAlgorithmSimulator::AdvanceTime(QuicTime::Delta delta) {
- clock_->AdvanceTime(delta);
-}
-
} // namespace net
diff --git a/net/quic/congestion_control/send_algorithm_simulator.h b/net/quic/congestion_control/send_algorithm_simulator.h
index 2685d23..50e78f3 100644
--- a/net/quic/congestion_control/send_algorithm_simulator.h
+++ b/net/quic/congestion_control/send_algorithm_simulator.h
@@ -122,6 +122,7 @@ class SendAlgorithmSimulator {
QuicTime::Delta rtt);
~SendAlgorithmSimulator();
+ // For local ad-hoc testing.
void set_bandwidth(QuicBandwidth bandwidth) {
bandwidth_ = bandwidth;
}
@@ -131,11 +132,13 @@ class SendAlgorithmSimulator {
forward_loss_rate_ = loss_rate;
}
+ // For local ad-hoc testing.
void set_reverse_loss_rate(float loss_rate) {
DCHECK_LT(loss_rate, 1.0f);
reverse_loss_rate_ = loss_rate;
}
+ // For local ad-hoc testing.
void set_loss_correlation(float loss_correlation) {
DCHECK_LT(loss_correlation, 1.0f);
loss_correlation_ = loss_correlation;
@@ -150,6 +153,7 @@ class SendAlgorithmSimulator {
}
// Advance the time by |delta| without sending anything.
+ // For local ad-hoc testing.
void AdvanceTime(QuicTime::Delta delta);
// Adds a pending sender. The send will run when TransferBytes is called.
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 4d77451..6cfe0fb 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -31,7 +31,6 @@ TcpCubicSender::TcpCubicSender(const QuicClock* clock,
const RttStats* rtt_stats,
bool reno,
QuicPacketCount initial_tcp_congestion_window,
- QuicPacketCount max_tcp_congestion_window,
QuicConnectionStats* stats)
: hybrid_slow_start_(clock),
cubic_(clock),
@@ -39,14 +38,13 @@ TcpCubicSender::TcpCubicSender(const QuicClock* clock,
stats_(stats),
reno_(reno),
num_connections_(kDefaultNumConnections),
- congestion_window_count_(0),
+ num_acked_packets_(0),
largest_sent_sequence_number_(0),
largest_acked_sequence_number_(0),
largest_sent_at_last_cutback_(0),
congestion_window_(initial_tcp_congestion_window),
- slowstart_threshold_(max_tcp_congestion_window),
+ slowstart_threshold_(std::numeric_limits<uint64>::max()),
last_cutback_exited_slowstart_(false),
- max_tcp_congestion_window_(max_tcp_congestion_window),
clock_(clock) {
}
@@ -89,8 +87,9 @@ bool TcpCubicSender::ResumeConnectionState(
// Make sure CWND is in appropriate range (in case of bad data).
QuicPacketCount new_congestion_window =
bandwidth.ToBytesPerPeriod(rtt_ms) / kMaxPacketSize;
- congestion_window_ = max(min(new_congestion_window, kMaxTcpCongestionWindow),
- kMinCongestionWindowForBandwidthResumption);
+ congestion_window_ = max(
+ min(new_congestion_window, kMaxCongestionWindowForBandwidthResumption),
+ kMinCongestionWindowForBandwidthResumption);
// TODO(rjshade): Set appropriate CWND when previous connection was in slow
// start at time of estimate.
@@ -181,7 +180,7 @@ void TcpCubicSender::OnPacketLost(QuicPacketSequenceNumber sequence_number,
largest_sent_at_last_cutback_ = largest_sent_sequence_number_;
// reset packet count from congestion avoidance mode. We start
// counting again when we're out of recovery.
- congestion_window_count_ = 0;
+ num_acked_packets_ = 0;
DVLOG(1) << "Incoming loss; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_;
}
@@ -216,7 +215,7 @@ QuicTime::Delta TcpCubicSender::TimeUntilSend(
if (InRecovery()) {
// PRR is used when in recovery.
return prr_.TimeUntilSend(GetCongestionWindow(), bytes_in_flight,
- slowstart_threshold_);
+ slowstart_threshold_ * kMaxSegmentSize);
}
if (GetCongestionWindow() > bytes_in_flight) {
return QuicTime::Delta::Zero();
@@ -302,36 +301,29 @@ void TcpCubicSender::MaybeIncreaseCwnd(
return;
}
if (InSlowStart()) {
- // congestion_window_cnt is the number of acks since last change of snd_cwnd
- if (congestion_window_ < max_tcp_congestion_window_) {
- // TCP slow start, exponential growth, increase by one for each ACK.
- ++congestion_window_;
- }
+ // TCP slow start, exponential growth, increase by one for each ACK.
+ ++congestion_window_;
DVLOG(1) << "Slow start; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_;
return;
}
- if (congestion_window_ >= max_tcp_congestion_window_) {
- return;
- }
// Congestion avoidance
if (reno_) {
// Classic Reno congestion avoidance.
- ++congestion_window_count_;
+ ++num_acked_packets_;
// Divide by num_connections to smoothly increase the CWND at a faster
// rate than conventional Reno.
- if (congestion_window_count_ * num_connections_ >= congestion_window_) {
+ if (num_acked_packets_ * num_connections_ >= congestion_window_) {
++congestion_window_;
- congestion_window_count_ = 0;
+ num_acked_packets_ = 0;
}
DVLOG(1) << "Reno; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_
- << " congestion window count: " << congestion_window_count_;
+ << " congestion window count: " << num_acked_packets_;
} else {
- congestion_window_ = min(max_tcp_congestion_window_,
- cubic_.CongestionWindowAfterAck(
- congestion_window_, rtt_stats_->min_rtt()));
+ congestion_window_ = cubic_.CongestionWindowAfterAck(congestion_window_,
+ rtt_stats_->min_rtt());
DVLOG(1) << "Cubic; congestion window: " << congestion_window_
<< " slowstart threshold: " << slowstart_threshold_;
}
diff --git a/net/quic/congestion_control/tcp_cubic_sender.h b/net/quic/congestion_control/tcp_cubic_sender.h
index e22894a..4659a4b 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.h
+++ b/net/quic/congestion_control/tcp_cubic_sender.h
@@ -31,12 +31,10 @@ class TcpCubicSenderPeer;
class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface {
public:
- // Reno option and max_tcp_congestion_window are provided for testing.
TcpCubicSender(const QuicClock* clock,
const RttStats* rtt_stats,
bool reno,
QuicPacketCount initial_tcp_congestion_window,
- QuicPacketCount max_tcp_congestion_window,
QuicConnectionStats* stats);
~TcpCubicSender() override;
@@ -102,7 +100,7 @@ class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface {
uint32 num_connections_;
// ACK counter for the Reno implementation.
- uint64 congestion_window_count_;
+ uint64 num_acked_packets_;
// Track the largest packet that has been sent.
QuicPacketSequenceNumber largest_sent_sequence_number_;
@@ -123,9 +121,6 @@ class NET_EXPORT_PRIVATE TcpCubicSender : public SendAlgorithmInterface {
// Used for stats collection of slowstart_packets_lost
bool last_cutback_exited_slowstart_;
- // Maximum number of outstanding packets for tcp.
- QuicPacketCount max_tcp_congestion_window_;
-
const QuicClock* clock_;
DISALLOW_COPY_AND_ASSIGN(TcpCubicSender);
diff --git a/net/quic/congestion_control/tcp_cubic_sender_test.cc b/net/quic/congestion_control/tcp_cubic_sender_test.cc
index 2d0f61c..ab5fcdb 100644
--- a/net/quic/congestion_control/tcp_cubic_sender_test.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender_test.cc
@@ -30,13 +30,12 @@ const float kRenoBeta = 0.7f; // Reno backoff factor.
class TcpCubicSenderPeer : public TcpCubicSender {
public:
- TcpCubicSenderPeer(const QuicClock* clock,
- bool reno,
- QuicPacketCount max_tcp_congestion_window)
- : TcpCubicSender(
- clock, &rtt_stats_, reno, kInitialCongestionWindowPackets,
- max_tcp_congestion_window, &stats_) {
- }
+ TcpCubicSenderPeer(const QuicClock* clock, bool reno)
+ : TcpCubicSender(clock,
+ &rtt_stats_,
+ reno,
+ kInitialCongestionWindowPackets,
+ &stats_) {}
QuicPacketCount congestion_window() {
return congestion_window_;
@@ -62,8 +61,7 @@ class TcpCubicSenderTest : public ::testing::Test {
protected:
TcpCubicSenderTest()
: one_ms_(QuicTime::Delta::FromMilliseconds(1)),
- sender_(new TcpCubicSenderPeer(&clock_, true,
- kMaxTcpCongestionWindow)),
+ sender_(new TcpCubicSenderPeer(&clock_, true)),
sequence_number_(1),
acked_sequence_number_(0),
bytes_in_flight_(0) {
@@ -208,8 +206,6 @@ TEST_F(TcpCubicSenderTest, ExponentialSlowStart) {
TEST_F(TcpCubicSenderTest, SlowStartAckTrain) {
sender_->SetNumEmulatedConnections(1);
- EXPECT_EQ(kMaxTcpCongestionWindow * kDefaultTCPMSS,
- sender_->GetSlowStartThreshold());
// Make sure that we fall out of slow start when we send ACK train longer
// than half the RTT, in this test case 30ms, which is more than 30 calls to
@@ -418,8 +414,6 @@ TEST_F(TcpCubicSenderTest, SlowStartBurstPacketLossPRR) {
TEST_F(TcpCubicSenderTest, RTOCongestionWindow) {
EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow());
- EXPECT_EQ(kMaxTcpCongestionWindow, sender_->slowstart_threshold());
-
// Expect the window to decrease to the minimum once the RTO fires
// and slow start threshold to be set to 1/2 of the CWND.
sender_->OnRetransmissionTimeout(true);
@@ -472,68 +466,6 @@ TEST_F(TcpCubicSenderTest, RetransmissionDelay) {
sender_->BandwidthEstimate().ToBytesPerSecond());
}
-TEST_F(TcpCubicSenderTest, SlowStartMaxSendWindow) {
- const QuicPacketCount kMaxCongestionWindowTCP = 50;
- const int kNumberOfAcks = 100;
- sender_.reset(
- new TcpCubicSenderPeer(&clock_, false, kMaxCongestionWindowTCP));
-
- for (int i = 0; i < kNumberOfAcks; ++i) {
- // Send our full send window.
- SendAvailableSendWindow();
- AckNPackets(2);
- }
- QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kDefaultTCPMSS;
- EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
-}
-
-TEST_F(TcpCubicSenderTest, TcpRenoMaxCongestionWindow) {
- const QuicPacketCount kMaxCongestionWindowTCP = 50;
- const int kNumberOfAcks = 1000;
- sender_.reset(
- new TcpCubicSenderPeer(&clock_, true, kMaxCongestionWindowTCP));
-
- SendAvailableSendWindow();
- AckNPackets(2);
- // Make sure we fall out of slow start.
- LoseNPackets(1);
-
- for (int i = 0; i < kNumberOfAcks; ++i) {
- // Send our full send window.
- SendAvailableSendWindow();
- AckNPackets(2);
- }
-
- QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kDefaultTCPMSS;
- EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
-}
-
-TEST_F(TcpCubicSenderTest, TcpCubicMaxCongestionWindow) {
- const QuicPacketCount kMaxCongestionWindowTCP = 50;
- // Set to 10000 to compensate for small cubic alpha.
- const int kNumberOfAcks = 10000;
-
- sender_.reset(
- new TcpCubicSenderPeer(&clock_, false, kMaxCongestionWindowTCP));
-
- SendAvailableSendWindow();
- AckNPackets(2);
- // Make sure we fall out of slow start.
- LoseNPackets(1);
-
- for (int i = 0; i < kNumberOfAcks; ++i) {
- // Send our full send window.
- SendAvailableSendWindow();
- AckNPackets(2);
- }
-
- QuicByteCount expected_send_window =
- kMaxCongestionWindowTCP * kDefaultTCPMSS;
- EXPECT_EQ(expected_send_window, sender_->GetCongestionWindow());
-}
-
TEST_F(TcpCubicSenderTest, MultipleLossesInOneWindow) {
SendAvailableSendWindow();
const QuicByteCount initial_window = sender_->GetCongestionWindow();
@@ -715,9 +647,10 @@ TEST_F(TcpCubicSenderTest, BandwidthResumption) {
// Resumed CWND is limited to be in a sensible range.
cached_network_params.set_bandwidth_estimate_bytes_per_second(
- (kMaxTcpCongestionWindow + 1) * kMaxPacketSize);
+ (kMaxCongestionWindowForBandwidthResumption + 1) * kMaxPacketSize);
EXPECT_TRUE(sender_->ResumeConnectionState(cached_network_params));
- EXPECT_EQ(kMaxTcpCongestionWindow, sender_->congestion_window());
+ EXPECT_EQ(kMaxCongestionWindowForBandwidthResumption,
+ sender_->congestion_window());
cached_network_params.set_bandwidth_estimate_bytes_per_second(
(kMinCongestionWindowForBandwidthResumption - 1) * kMaxPacketSize);
diff --git a/net/quic/crypto/crypto_handshake_message.cc b/net/quic/crypto/crypto_handshake_message.cc
index 73fc9cf..296e194 100644
--- a/net/quic/crypto/crypto_handshake_message.cc
+++ b/net/quic/crypto/crypto_handshake_message.cc
@@ -165,11 +165,6 @@ QuicErrorCode CryptoHandshakeMessage::GetNthValue24(QuicTag tag,
}
}
-QuicErrorCode CryptoHandshakeMessage::GetUint16(QuicTag tag,
- uint16* out) const {
- return GetPOD(tag, out, sizeof(uint16));
-}
-
QuicErrorCode CryptoHandshakeMessage::GetUint32(QuicTag tag,
uint32* out) const {
return GetPOD(tag, out, sizeof(uint32));
@@ -244,6 +239,7 @@ string CryptoHandshakeMessage::DebugStringInternal(size_t indent) const {
case kSFCW:
case kIRTT:
case kMSPC:
+ case kSRBF:
case kSWND:
// uint32 value
if (it->second.size() == 4) {
diff --git a/net/quic/crypto/crypto_handshake_message.h b/net/quic/crypto/crypto_handshake_message.h
index fcb3930..7b68659 100644
--- a/net/quic/crypto/crypto_handshake_message.h
+++ b/net/quic/crypto/crypto_handshake_message.h
@@ -85,7 +85,6 @@ class NET_EXPORT_PRIVATE CryptoHandshakeMessage {
QuicErrorCode GetNthValue24(QuicTag tag,
unsigned index,
base::StringPiece* out) const;
- QuicErrorCode GetUint16(QuicTag tag, uint16* out) const;
QuicErrorCode GetUint32(QuicTag tag, uint32* out) const;
QuicErrorCode GetUint64(QuicTag tag, uint64* out) const;
diff --git a/net/quic/crypto/crypto_protocol.h b/net/quic/crypto/crypto_protocol.h
index ae7e78d..821874e 100644
--- a/net/quic/crypto/crypto_protocol.h
+++ b/net/quic/crypto/crypto_protocol.h
@@ -59,9 +59,6 @@ const QuicTag k1CON = TAG('1', 'C', 'O', 'N'); // Emulate a single connection
const QuicTag kNTLP = TAG('N', 'T', 'L', 'P'); // No tail loss probe
const QuicTag kNCON = TAG('N', 'C', 'O', 'N'); // N Connection Congestion Ctrl
const QuicTag kNRTO = TAG('N', 'R', 'T', 'O'); // CWND reduction on loss
-
-// Loss detection algorithm types
-const QuicTag kNACK = TAG('N', 'A', 'C', 'K'); // TCP style nack counting
const QuicTag kTIME = TAG('T', 'I', 'M', 'E'); // Time based
// Optional support of truncated Connection IDs. If sent by a peer, the value
diff --git a/net/quic/quic_bandwidth_test.cc b/net/quic/quic_bandwidth_test.cc
index 04fe93b..7f07a6a 100644
--- a/net/quic/quic_bandwidth_test.cc
+++ b/net/quic/quic_bandwidth_test.cc
@@ -84,5 +84,18 @@ TEST_F(QuicBandwidthTest, TransferTime) {
EXPECT_EQ(QuicTime::Delta::Zero(), QuicBandwidth::Zero().TransferTime(1000));
}
+TEST_F(QuicBandwidthTest, RelOps) {
+ const QuicBandwidth b1 = QuicBandwidth::FromKBitsPerSecond(1);
+ const QuicBandwidth b2 = QuicBandwidth::FromKBytesPerSecond(2);
+ EXPECT_EQ(b1, b1);
+ EXPECT_NE(b1, b2);
+ EXPECT_LT(b1, b2);
+ EXPECT_GT(b2, b1);
+ EXPECT_LE(b1, b1);
+ EXPECT_LE(b1, b2);
+ EXPECT_GE(b1, b1);
+ EXPECT_GE(b2, b1);
+}
+
} // namespace test
} // namespace net
diff --git a/net/quic/quic_config.cc b/net/quic/quic_config.cc
index 803ae7f..f3e93aa 100644
--- a/net/quic/quic_config.cc
+++ b/net/quic/quic_config.cc
@@ -280,74 +280,6 @@ QuicErrorCode QuicFixedUint32::ProcessPeerHello(
return error;
}
-QuicFixedTag::QuicFixedTag(QuicTag name,
- QuicConfigPresence presence)
- : QuicConfigValue(name, presence),
- has_send_value_(false),
- has_receive_value_(false) {
-}
-
-QuicFixedTag::~QuicFixedTag() {}
-
-bool QuicFixedTag::HasSendValue() const {
- return has_send_value_;
-}
-
-uint32 QuicFixedTag::GetSendValue() const {
- LOG_IF(DFATAL, !has_send_value_)
- << "No send value to get for tag:" << QuicUtils::TagToString(tag_);
- return send_value_;
-}
-
-void QuicFixedTag::SetSendValue(uint32 value) {
- has_send_value_ = true;
- send_value_ = value;
-}
-
-bool QuicFixedTag::HasReceivedValue() const {
- return has_receive_value_;
-}
-
-uint32 QuicFixedTag::GetReceivedValue() const {
- LOG_IF(DFATAL, !has_receive_value_)
- << "No receive value to get for tag:" << QuicUtils::TagToString(tag_);
- return receive_value_;
-}
-
-void QuicFixedTag::SetReceivedValue(uint32 value) {
- has_receive_value_ = true;
- receive_value_ = value;
-}
-
-void QuicFixedTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
- if (has_send_value_) {
- out->SetValue(tag_, send_value_);
- }
-}
-
-QuicErrorCode QuicFixedTag::ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- string* error_details) {
- DCHECK(error_details != nullptr);
- QuicErrorCode error = peer_hello.GetUint32(tag_, &receive_value_);
- switch (error) {
- case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
- if (presence_ == PRESENCE_OPTIONAL) {
- return QUIC_NO_ERROR;
- }
- *error_details = "Missing " + QuicUtils::TagToString(tag_);
- break;
- case QUIC_NO_ERROR:
- has_receive_value_ = true;
- break;
- default:
- *error_details = "Bad " + QuicUtils::TagToString(tag_);
- break;
- }
- return error;
-}
-
QuicFixedTagVector::QuicFixedTagVector(QuicTag name,
QuicConfigPresence presence)
: QuicConfigValue(name, presence),
@@ -476,6 +408,7 @@ QuicTime::Delta QuicConfig::IdleConnectionStateLifetime() const {
idle_connection_state_lifetime_seconds_.GetUint32());
}
+// TODO(ianswett) Use this for silent close on mobile, or delete.
void QuicConfig::SetSilentClose(bool silent_close) {
silent_close_.set(silent_close ? 1 : 0, silent_close ? 1 : 0);
}
@@ -577,10 +510,6 @@ void QuicConfig::SetSocketReceiveBufferToSend(uint32 tcp_receive_window) {
socket_receive_buffer_.SetSendValue(tcp_receive_window);
}
-uint32 QuicConfig::GetSocketReceiveBufferToSend() const {
- return socket_receive_buffer_.GetSendValue();
-}
-
bool QuicConfig::HasReceivedSocketReceiveBuffer() const {
return socket_receive_buffer_.HasReceivedValue();
}
diff --git a/net/quic/quic_config.h b/net/quic/quic_config.h
index 83e0618..ceb56e2 100644
--- a/net/quic/quic_config.h
+++ b/net/quic/quic_config.h
@@ -182,39 +182,6 @@ class NET_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue {
};
// Stores tag from CHLO or SHLO messages that are not negotiated.
-class NET_EXPORT_PRIVATE QuicFixedTag : public QuicConfigValue {
- public:
- QuicFixedTag(QuicTag name, QuicConfigPresence presence);
- ~QuicFixedTag() override;
-
- bool HasSendValue() const;
-
- QuicTag GetSendValue() const;
-
- void SetSendValue(QuicTag value);
-
- bool HasReceivedValue() const;
-
- QuicTag GetReceivedValue() const;
-
- void SetReceivedValue(QuicTag value);
-
- // If has_send_value is true, serialises |tag_| and |send_value_| to |out|.
- void ToHandshakeMessage(CryptoHandshakeMessage* out) const override;
-
- // Sets |value_| to the corresponding value from |client_hello_| if it exists.
- QuicErrorCode ProcessPeerHello(const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- std::string* error_details) override;
-
- private:
- QuicTag send_value_;
- bool has_send_value_;
- QuicTag receive_value_;
- bool has_receive_value_;
-};
-
-// Stores tag from CHLO or SHLO messages that are not negotiated.
class NET_EXPORT_PRIVATE QuicFixedTagVector : public QuicConfigValue {
public:
QuicFixedTagVector(QuicTag name, QuicConfigPresence presence);
@@ -348,8 +315,6 @@ class NET_EXPORT_PRIVATE QuicConfig {
// Sets socket receive buffer to transmit to the peer.
void SetSocketReceiveBufferToSend(uint32 window_bytes);
- uint32 GetSocketReceiveBufferToSend() const;
-
bool HasReceivedSocketReceiveBuffer() const;
uint32 ReceivedSocketReceiveBuffer() const;
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index aca4d20..4a510fb 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -61,9 +61,6 @@ const size_t kMaxFecGroups = 2;
// Maximum number of acks received before sending an ack in response.
const QuicPacketCount kMaxPacketsReceivedBeforeAckSend = 20;
-// Maximum number of tracked packets.
-const QuicPacketCount kMaxTrackedPackets = 5 * kMaxTcpCongestionWindow;
-
bool Near(QuicPacketSequenceNumber a, QuicPacketSequenceNumber b) {
QuicPacketSequenceNumber delta = (a > b) ? a - b : b - a;
return delta <= kMaxPacketGap;
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 1964e1e..c23ea73 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -711,13 +711,6 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
return encrypted->length();
}
- void ProcessPingPacket(QuicPacketSequenceNumber number) {
- scoped_ptr<QuicPacket> packet(ConstructPingPacket(number));
- scoped_ptr<QuicEncryptedPacket> encrypted(framer_.EncryptPacket(
- ENCRYPTION_NONE, number, *packet));
- connection_.ProcessUdpPacket(IPEndPoint(), IPEndPoint(), *encrypted);
- }
-
void ProcessClosePacket(QuicPacketSequenceNumber number,
QuicFecGroupNumber fec_group) {
scoped_ptr<QuicPacket> packet(ConstructClosePacket(number, fec_group));
@@ -1359,8 +1352,8 @@ TEST_P(QuicConnectionTest, LeastUnackedLower) {
TEST_P(QuicConnectionTest, TooManySentPackets) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
-
- for (int i = 0; i < 1100; ++i) {
+ const QuicPacketCount num_sent_packets = kMaxTrackedPackets + 100;
+ for (QuicPacketCount i = 0; i < num_sent_packets; ++i) {
SendStreamDataToPeer(1, "foo", 3 * i, !kFin, nullptr);
}
@@ -1372,8 +1365,8 @@ TEST_P(QuicConnectionTest, TooManySentPackets) {
EXPECT_CALL(visitor_, OnCanWrite()).Times(0);
// Nack every packet except the last one, leaving a huge gap.
- QuicAckFrame frame1 = InitAckFrame(1100);
- for (QuicPacketSequenceNumber i = 1; i < 1100; ++i) {
+ QuicAckFrame frame1 = InitAckFrame(num_sent_packets);
+ for (QuicPacketSequenceNumber i = 1; i < num_sent_packets; ++i) {
NackPacket(i, &frame1);
}
ProcessAckPacket(&frame1);
@@ -1384,8 +1377,8 @@ TEST_P(QuicConnectionTest, TooManyReceivedPackets) {
EXPECT_CALL(visitor_, OnConnectionClosed(
QUIC_TOO_MANY_OUTSTANDING_RECEIVED_PACKETS, false));
- // Miss every other packet for 1000 packets.
- for (QuicPacketSequenceNumber i = 1; i < 1000; ++i) {
+ // Miss every other packet for 5000 packets.
+ for (QuicPacketSequenceNumber i = 1; i < kMaxTrackedPackets; ++i) {
ProcessPacket(i * 2);
if (!connection_.connected()) {
break;
diff --git a/net/quic/quic_crypto_client_stream.cc b/net/quic/quic_crypto_client_stream.cc
index c7c0291..eaff528 100644
--- a/net/quic/quic_crypto_client_stream.cc
+++ b/net/quic/quic_crypto_client_stream.cc
@@ -134,6 +134,7 @@ int QuicCryptoClientStream::num_sent_client_hellos() const {
return num_client_hellos_;
}
+// Used in Chromium, but not in the server.
bool QuicCryptoClientStream::WasChannelIDSent() const {
return channel_id_sent_;
}
diff --git a/net/quic/quic_crypto_stream_test.cc b/net/quic/quic_crypto_stream_test.cc
index 3c62644..0abd49d 100644
--- a/net/quic/quic_crypto_stream_test.cc
+++ b/net/quic/quic_crypto_stream_test.cc
@@ -102,7 +102,6 @@ TEST_F(QuicCryptoStreamTest, ProcessBadData) {
}
TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) {
- EXPECT_TRUE(stream_.flow_controller()->IsEnabled());
EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
&stream_));
}
diff --git a/net/quic/quic_data_reader.cc b/net/quic/quic_data_reader.cc
index b9a6acf..7542c83 100644
--- a/net/quic/quic_data_reader.cc
+++ b/net/quic/quic_data_reader.cc
@@ -25,43 +25,10 @@ bool QuicDataReader::ReadUInt32(uint32* result) {
return ReadBytes(result, sizeof(*result));
}
-bool QuicDataReader::ReadUInt48(uint64* result) {
- uint32 lo;
- if (!ReadUInt32(&lo)) {
- return false;
- }
-
- uint16 hi;
- if (!ReadUInt16(&hi)) {
- return false;
- }
-
- *result = hi;
- *result <<= 32;
- *result += lo;
-
- return true;
-}
-
bool QuicDataReader::ReadUInt64(uint64* result) {
return ReadBytes(result, sizeof(*result));
}
-bool QuicDataReader::ReadUInt128(uint128* result) {
- uint64 high_hash;
- uint64 low_hash;
-
- if (!ReadUInt64(&low_hash)) {
- return false;
- }
- if (!ReadUInt64(&high_hash)) {
- return false;
- }
-
- *result = uint128(high_hash, low_hash);
- return true;
-}
-
bool QuicDataReader::ReadUFloat16(uint64* result) {
uint16 value;
if (!ReadUInt16(&value)) {
diff --git a/net/quic/quic_data_reader.h b/net/quic/quic_data_reader.h
index 1686de0..3384e20 100644
--- a/net/quic/quic_data_reader.h
+++ b/net/quic/quic_data_reader.h
@@ -44,21 +44,11 @@ class NET_EXPORT_PRIVATE QuicDataReader {
// Returns true on success, false otherwise.
bool ReadUInt32(uint32* result);
- // Reads a 48-bit unsigned integer into the given output parameter.
- // Forwards the internal iterator on success.
- // Returns true on success, false otherwise.
- bool ReadUInt48(uint64* result);
-
// Reads a 64-bit unsigned integer into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
bool ReadUInt64(uint64* result);
- // Reads a 128-bit unsigned integer into the given output parameter.
- // Forwards the internal iterator on success.
- // Returns true on success, false otherwise.
- bool ReadUInt128(uint128* result);
-
// Reads a 16-bit unsigned float into the given output parameter.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
diff --git a/net/quic/quic_data_stream.cc b/net/quic/quic_data_stream.cc
index aa24d0c..10f8b4c 100644
--- a/net/quic/quic_data_stream.cc
+++ b/net/quic/quic_data_stream.cc
@@ -26,14 +26,11 @@ QuicPriority kDefaultPriority = 3;
} // namespace
-QuicDataStream::QuicDataStream(QuicStreamId id,
- QuicSession* session)
+QuicDataStream::QuicDataStream(QuicStreamId id, QuicSession* session)
: ReliableQuicStream(id, session),
visitor_(nullptr),
headers_decompressed_(false),
- priority_(kDefaultPriority),
- decompression_failed_(false),
- priority_parsed_(false) {
+ priority_(kDefaultPriority) {
DCHECK_NE(kCryptoStreamId, id);
// Don't receive any callbacks from the sequencer until headers
// are complete.
diff --git a/net/quic/quic_data_stream.h b/net/quic/quic_data_stream.h
index 965a5ae..c80cacf 100644
--- a/net/quic/quic_data_stream.h
+++ b/net/quic/quic_data_stream.h
@@ -135,10 +135,6 @@ class NET_EXPORT_PRIVATE QuicDataStream : public ReliableQuicStream {
// Contains a copy of the decompressed headers until they are consumed
// via ProcessData or Readv.
std::string decompressed_headers_;
- // True if an error was encountered during decompression.
- bool decompression_failed_;
- // True if the priority has been read, false otherwise.
- bool priority_parsed_;
DISALLOW_COPY_AND_ASSIGN(QuicDataStream);
};
diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
index 1c6e47f..05bc044 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -159,37 +159,5 @@ void QuicDataWriter::WritePadding() {
length_ = capacity_;
}
-bool QuicDataWriter::WriteUInt8ToOffset(uint8 value, size_t offset) {
- if (offset >= capacity_) {
- LOG(DFATAL) << "offset: " << offset << " >= capacity: " << capacity_;
- return false;
- }
- size_t latched_length = length_;
- length_ = offset;
- bool success = WriteUInt8(value);
- DCHECK_LE(length_, latched_length);
- length_ = latched_length;
- return success;
-}
-
-bool QuicDataWriter::WriteUInt32ToOffset(uint32 value, size_t offset) {
- DCHECK_LT(offset, capacity_);
- size_t latched_length = length_;
- length_ = offset;
- bool success = WriteUInt32(value);
- DCHECK_LE(length_, latched_length);
- length_ = latched_length;
- return success;
-}
-
-bool QuicDataWriter::WriteUInt48ToOffset(uint64 value, size_t offset) {
- DCHECK_LT(offset, capacity_);
- size_t latched_length = length_;
- length_ = offset;
- bool success = WriteUInt48(value);
- DCHECK_LE(length_, latched_length);
- length_ = latched_length;
- return success;
-}
} // namespace net
diff --git a/net/quic/quic_data_writer.h b/net/quic/quic_data_writer.h
index 4b5958e..caffcf1 100644
--- a/net/quic/quic_data_writer.h
+++ b/net/quic/quic_data_writer.h
@@ -54,13 +54,6 @@ class NET_EXPORT_PRIVATE QuicDataWriter {
// Fills the remaining buffer with null characters.
void WritePadding();
- // Methods for editing the payload at a specific offset, where the
- // offset must be within the writer's capacity.
- // Return true if there is enough space at that offset, false otherwise.
- bool WriteUInt8ToOffset(uint8 value, size_t offset);
- bool WriteUInt32ToOffset(uint32 value, size_t offset);
- bool WriteUInt48ToOffset(uint64 value, size_t offset);
-
size_t capacity() const {
return capacity_;
}
diff --git a/net/quic/quic_data_writer_test.cc b/net/quic/quic_data_writer_test.cc
index 01b3c6d..a7ac2a8 100644
--- a/net/quic/quic_data_writer_test.cc
+++ b/net/quic/quic_data_writer_test.cc
@@ -13,30 +13,6 @@ namespace net {
namespace test {
namespace {
-TEST(QuicDataWriterTest, WriteUInt8ToOffset) {
- char buffer[4];
- QuicDataWriter writer(4, buffer);
-
- writer.WriteUInt32(0xfefdfcfb);
- EXPECT_TRUE(writer.WriteUInt8ToOffset(1, 0));
- EXPECT_TRUE(writer.WriteUInt8ToOffset(2, 1));
- EXPECT_TRUE(writer.WriteUInt8ToOffset(3, 2));
- EXPECT_TRUE(writer.WriteUInt8ToOffset(4, 3));
-
- EXPECT_EQ(1, writer.data()[0]);
- EXPECT_EQ(2, writer.data()[1]);
- EXPECT_EQ(3, writer.data()[2]);
- EXPECT_EQ(4, writer.data()[3]);
-}
-
-TEST(QuicDataWriterDeathTest, WriteUInt8ToOffset) {
- char buffer[4];
- QuicDataWriter writer(4, buffer);
-
- EXPECT_DFATAL(EXPECT_FALSE(writer.WriteUInt8ToOffset(5, 4)),
- "offset: 4 >= capacity: 4");
-}
-
TEST(QuicDataWriterTest, SanityCheckUFloat16Consts) {
// Check the arithmetic on the constants - otherwise the values below make
// no sense.
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index f750bfa..1ce40c9d 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -361,28 +361,17 @@ QuicSession* QuicDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
const IPEndPoint& server_address,
const IPEndPoint& client_address) {
- QuicServerSession* session = new QuicServerSession(
- config_,
- CreateQuicConnection(connection_id, server_address, client_address),
- this);
+ // The QuicSession takes ownership of |connection| below.
+ QuicConnection* connection = new QuicConnection(
+ connection_id, client_address, helper_, connection_writer_factory_,
+ /* owns_writer= */ true, /* is_server= */ true,
+ crypto_config_.HasProofSource(), supported_versions_);
+
+ QuicServerSession* session = new QuicServerSession(config_, connection, this);
session->InitializeSession(crypto_config_);
return session;
}
-QuicConnection* QuicDispatcher::CreateQuicConnection(
- QuicConnectionId connection_id,
- const IPEndPoint& server_address,
- const IPEndPoint& client_address) {
- return new QuicConnection(connection_id,
- client_address,
- helper_,
- connection_writer_factory_,
- /* owns_writer= */ true,
- /* is_server= */ true,
- crypto_config_.HasProofSource(),
- supported_versions_);
-}
-
QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() {
return new QuicTimeWaitListManager(
writer_.get(), this, helper_, supported_versions());
diff --git a/net/quic/quic_dispatcher.h b/net/quic/quic_dispatcher.h
index 8e2ce03..c507556 100644
--- a/net/quic/quic_dispatcher.h
+++ b/net/quic/quic_dispatcher.h
@@ -129,11 +129,6 @@ class QuicDispatcher : public QuicBlockedWriterInterface,
const IPEndPoint& server_address,
const IPEndPoint& client_address);
- virtual QuicConnection* CreateQuicConnection(
- QuicConnectionId connection_id,
- const IPEndPoint& server_address,
- const IPEndPoint& client_address);
-
// Called by |framer_visitor_| when the public header has been parsed.
virtual bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header);
@@ -142,11 +137,6 @@ class QuicDispatcher : public QuicBlockedWriterInterface,
// will be owned by the dispatcher as time_wait_list_manager_
virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager();
- // Replaces the packet writer with |writer|. Takes ownership of |writer|.
- void set_writer(QuicServerPacketWriter* writer) {
- writer_.reset(writer);
- }
-
QuicTimeWaitListManager* time_wait_list_manager() {
return time_wait_list_manager_.get();
}
diff --git a/net/quic/quic_flags.cc b/net/quic/quic_flags.cc
index e19d926..ac5cc86 100644
--- a/net/quic/quic_flags.cc
+++ b/net/quic/quic_flags.cc
@@ -52,9 +52,5 @@ int64 FLAGS_quic_time_wait_list_seconds = 5;
// no configured limit.
int64 FLAGS_quic_time_wait_list_max_connections = 50000;
-// If true, limit the number of connections on the quic time-wait list using a
-// flag.
-bool FLAGS_quic_limit_time_wait_list_size = true;
-
// Use small QUIC packet sizes by default.
bool FLAGS_quic_small_default_packet_size = true;
diff --git a/net/quic/quic_flags.h b/net/quic/quic_flags.h
index c32b50d..bb18b49 100644
--- a/net/quic/quic_flags.h
+++ b/net/quic/quic_flags.h
@@ -21,7 +21,6 @@ NET_EXPORT_PRIVATE extern bool FLAGS_quic_enable_pacing;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_use_multiple_address_in_source_tokens;
NET_EXPORT_PRIVATE extern int64 FLAGS_quic_time_wait_list_seconds;
NET_EXPORT_PRIVATE extern int64 FLAGS_quic_time_wait_list_max_connections;
-NET_EXPORT_PRIVATE extern bool FLAGS_quic_limit_time_wait_list_size;
NET_EXPORT_PRIVATE extern bool FLAGS_quic_small_default_packet_size;
#endif // NET_QUIC_QUIC_FLAGS_H_
diff --git a/net/quic/quic_flow_controller.cc b/net/quic/quic_flow_controller.cc
index 59ae8c0..1fedd06 100644
--- a/net/quic/quic_flow_controller.cc
+++ b/net/quic/quic_flow_controller.cc
@@ -21,7 +21,6 @@ QuicFlowController::QuicFlowController(QuicConnection* connection,
QuicByteCount max_receive_window)
: connection_(connection),
id_(id),
- is_enabled_(true),
is_server_(is_server),
bytes_consumed_(0),
highest_received_byte_offset_(0),
@@ -39,10 +38,6 @@ QuicFlowController::QuicFlowController(QuicConnection* connection,
}
void QuicFlowController::AddBytesConsumed(QuicByteCount bytes_consumed) {
- if (!IsEnabled()) {
- return;
- }
-
bytes_consumed_ += bytes_consumed;
DVLOG(1) << ENDPOINT << "Stream " << id_ << " consumed: " << bytes_consumed_;
@@ -51,10 +46,6 @@ void QuicFlowController::AddBytesConsumed(QuicByteCount bytes_consumed) {
bool QuicFlowController::UpdateHighestReceivedOffset(
QuicStreamOffset new_offset) {
- if (!IsEnabled()) {
- return false;
- }
-
// Only update if offset has increased.
if (new_offset <= highest_received_byte_offset_) {
return false;
@@ -68,10 +59,6 @@ bool QuicFlowController::UpdateHighestReceivedOffset(
}
void QuicFlowController::AddBytesSent(QuicByteCount bytes_sent) {
- if (!IsEnabled()) {
- return;
- }
-
if (bytes_sent_ + bytes_sent > send_window_offset_) {
LOG(DFATAL) << ENDPOINT << "Stream " << id_ << " Trying to send an extra "
<< bytes_sent << " bytes, when bytes_sent = " << bytes_sent_
@@ -88,10 +75,6 @@ void QuicFlowController::AddBytesSent(QuicByteCount bytes_sent) {
}
bool QuicFlowController::FlowControlViolation() {
- if (!IsEnabled()) {
- return false;
- }
-
if (highest_received_byte_offset_ > receive_window_offset_) {
LOG(ERROR) << ENDPOINT << "Flow control violation on stream "
<< id_ << ", receive window offset: "
@@ -104,10 +87,6 @@ bool QuicFlowController::FlowControlViolation() {
}
void QuicFlowController::MaybeSendWindowUpdate() {
- if (!IsEnabled()) {
- return;
- }
-
// Send WindowUpdate to increase receive window if
// (receive window offset - consumed bytes) < (max window / 2).
// This is behaviour copied from SPDY.
@@ -132,10 +111,6 @@ void QuicFlowController::MaybeSendWindowUpdate() {
}
void QuicFlowController::MaybeSendBlocked() {
- if (!IsEnabled()) {
- return;
- }
-
if (SendWindowSize() == 0 &&
last_blocked_send_window_offset_ < send_window_offset_) {
DVLOG(1) << ENDPOINT << "Stream " << id_ << " is flow control blocked. "
@@ -154,10 +129,6 @@ void QuicFlowController::MaybeSendBlocked() {
bool QuicFlowController::UpdateSendWindowOffset(
QuicStreamOffset new_send_window_offset) {
- if (!IsEnabled()) {
- return false;
- }
-
// Only update if send window has increased.
if (new_send_window_offset <= send_window_offset_) {
return false;
@@ -173,16 +144,8 @@ bool QuicFlowController::UpdateSendWindowOffset(
return blocked;
}
-void QuicFlowController::Disable() {
- is_enabled_ = false;
-}
-
-bool QuicFlowController::IsEnabled() const {
- return is_enabled_;
-}
-
bool QuicFlowController::IsBlocked() const {
- return IsEnabled() && SendWindowSize() == 0;
+ return SendWindowSize() == 0;
}
uint64 QuicFlowController::SendWindowSize() const {
diff --git a/net/quic/quic_flow_controller.h b/net/quic/quic_flow_controller.h
index 371b8c9..1b5ed61 100644
--- a/net/quic/quic_flow_controller.h
+++ b/net/quic/quic_flow_controller.h
@@ -56,12 +56,6 @@ class NET_EXPORT_PRIVATE QuicFlowController {
// Send a BLOCKED frame if appropriate.
void MaybeSendBlocked();
- // Disable flow control.
- void Disable();
-
- // Returns true if flow control is enabled.
- bool IsEnabled() const;
-
// Returns true if flow control send limits have been reached.
bool IsBlocked() const;
@@ -89,9 +83,6 @@ class NET_EXPORT_PRIVATE QuicFlowController {
// connection level flow controller.
QuicStreamId id_;
- // True if flow control is enabled.
- bool is_enabled_;
-
// True if this is owned by a server.
bool is_server_;
diff --git a/net/quic/quic_flow_controller_test.cc b/net/quic/quic_flow_controller_test.cc
index e3fcafe..b3c75c4 100644
--- a/net/quic/quic_flow_controller_test.cc
+++ b/net/quic/quic_flow_controller_test.cc
@@ -44,7 +44,6 @@ class QuicFlowControllerTest : public ::testing::Test {
TEST_F(QuicFlowControllerTest, SendingBytes) {
Initialize();
- EXPECT_TRUE(flow_controller_->IsEnabled());
EXPECT_FALSE(flow_controller_->IsBlocked());
EXPECT_FALSE(flow_controller_->FlowControlViolation());
EXPECT_EQ(send_window_, flow_controller_->SendWindowSize());
@@ -86,7 +85,6 @@ TEST_F(QuicFlowControllerTest, SendingBytes) {
TEST_F(QuicFlowControllerTest, ReceivingBytes) {
Initialize();
- EXPECT_TRUE(flow_controller_->IsEnabled());
EXPECT_FALSE(flow_controller_->IsBlocked());
EXPECT_FALSE(flow_controller_->FlowControlViolation());
EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
@@ -116,7 +114,6 @@ TEST_F(QuicFlowControllerTest, OnlySendBlockedFrameOncePerOffset) {
// Test that we don't send duplicate BLOCKED frames. We should only send one
// BLOCKED frame at a given send window offset.
- EXPECT_TRUE(flow_controller_->IsEnabled());
EXPECT_FALSE(flow_controller_->IsBlocked());
EXPECT_FALSE(flow_controller_->FlowControlViolation());
EXPECT_EQ(send_window_, flow_controller_->SendWindowSize());
diff --git a/net/quic/quic_headers_stream_test.cc b/net/quic/quic_headers_stream_test.cc
index 9d684ac..d4cf018 100644
--- a/net/quic/quic_headers_stream_test.cc
+++ b/net/quic/quic_headers_stream_test.cc
@@ -457,7 +457,6 @@ TEST_P(QuicHeadersStreamTest, ProcessSpdyWindowUpdateFrame) {
}
TEST_P(QuicHeadersStreamTest, NoConnectionLevelFlowControl) {
- EXPECT_TRUE(headers_stream_->flow_controller()->IsEnabled());
EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
headers_stream_));
}
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index d61998a..a43d027 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -215,10 +215,6 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
static bool ShouldRetransmit(const QuicFrame& frame);
- // Updates sequence number and max packet lengths on a packet or FEC group
- // boundary.
- void MaybeUpdateLengths();
-
// Updates lengths and also starts an FEC group if FEC protection is on and
// there is not already an FEC group open.
InFecGroup MaybeUpdateLengthsAndStartFec();
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 548755e..7d33a8a 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -68,11 +68,14 @@ const QuicPacketCount kInitialCongestionWindowInsecure = 20;
// Minimum size of initial flow control window, for both stream and session.
const uint32 kMinimumFlowControlSendWindow = 16 * 1024; // 16 KB
-// Minimum size of the CWND, in packets, when doing bandwidth resumption.
+// Minimum and maximum size of the CWND, in packets,
+// when doing bandwidth resumption.
const QuicPacketCount kMinCongestionWindowForBandwidthResumption = 10;
+const QuicPacketCount kMaxCongestionWindowForBandwidthResumption = 200;
-// Maximum size of the CWND, in packets, for TCP congestion control algorithms.
-const QuicPacketCount kMaxTcpCongestionWindow = 200;
+// Maximum number of tracked packets before the connection will be closed.
+// This effectively limits the max CWND to a smaller value than this.
+const QuicPacketCount kMaxTrackedPackets = 5000;
// Default size of the socket receive buffer in bytes.
const QuicByteCount kDefaultSocketReceiveBuffer = 256 * 1024;
@@ -106,8 +109,6 @@ const size_t kStartOfHashData = 0;
// Limit on the delta between stream IDs.
const QuicStreamId kMaxStreamIdDelta = 200;
-// Limit on the delta between header IDs.
-const QuicHeaderId kMaxHeaderIdDelta = 200;
// Reserved ID for the crypto stream.
const QuicStreamId kCryptoStreamId = 1;
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 9c502f4..242d8e7 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -435,16 +435,14 @@ QuicSentPacketManager::PendingRetransmission
TransmissionType transmission_type = pending_retransmissions_.begin()->second;
if (unacked_packets_.HasPendingCryptoPackets()) {
// Ensure crypto packets are retransmitted before other packets.
- PendingRetransmissionMap::const_iterator it =
- pending_retransmissions_.begin();
- do {
- if (HasCryptoHandshake(unacked_packets_.GetTransmissionInfo(it->first))) {
- sequence_number = it->first;
- transmission_type = it->second;
+ for (const auto& pair : pending_retransmissions_) {
+ if (HasCryptoHandshake(
+ unacked_packets_.GetTransmissionInfo(pair.first))) {
+ sequence_number = pair.first;
+ transmission_type = pair.second;
break;
}
- ++it;
- } while (it != pending_retransmissions_.end());
+ }
}
DCHECK(unacked_packets_.IsUnacked(sequence_number)) << sequence_number;
const TransmissionInfo& transmission_info =
diff --git a/net/quic/quic_sent_packet_manager.h b/net/quic/quic_sent_packet_manager.h
index d4d68e8..d917106 100644
--- a/net/quic/quic_sent_packet_manager.h
+++ b/net/quic/quic_sent_packet_manager.h
@@ -238,10 +238,12 @@ class NET_EXPORT_PRIVATE QuicSentPacketManager {
network_change_visitor_ = visitor;
}
+ // Used in Chromium, but not in the server.
size_t consecutive_rto_count() const {
return consecutive_rto_count_;
}
+ // Used in Chromium, but not in the server.
size_t consecutive_tlp_count() const {
return consecutive_tlp_count_;
}
diff --git a/net/quic/quic_server_id.h b/net/quic/quic_server_id.h
index 6d01670..7236bfc 100644
--- a/net/quic/quic_server_id.h
+++ b/net/quic/quic_server_id.h
@@ -39,6 +39,7 @@ class NET_EXPORT_PRIVATE QuicServerId {
// based on |is_https|.
std::string ToString() const;
+ // Used in Chromium, but not in the server.
const HostPortPair& host_port_pair() const { return host_port_pair_; }
const std::string& host() const { return host_port_pair_.host(); }
diff --git a/net/quic/quic_session.cc b/net/quic/quic_session.cc
index f102845..993f429 100644
--- a/net/quic/quic_session.cc
+++ b/net/quic/quic_session.cc
@@ -412,8 +412,7 @@ void QuicSession::CloseStreamInner(QuicStreamId stream_id,
// If we haven't received a FIN or RST for this stream, we need to keep track
// of the how many bytes the stream's flow controller believes it has
// received, for accurate connection level flow control accounting.
- if (!stream->HasFinalReceivedByteOffset() &&
- stream->flow_controller()->IsEnabled()) {
+ if (!stream->HasFinalReceivedByteOffset()) {
locally_closed_streams_highest_offset_[stream_id] =
stream->flow_controller()->highest_received_byte_offset();
}
diff --git a/net/quic/quic_stream_sequencer_test.cc b/net/quic/quic_stream_sequencer_test.cc
index 6e3d57d..39cea58 100644
--- a/net/quic/quic_stream_sequencer_test.cc
+++ b/net/quic/quic_stream_sequencer_test.cc
@@ -69,13 +69,6 @@ class QuicStreamSequencerTest : public ::testing::Test {
QuicStreamSequencerPeer::GetBufferedFrames(sequencer_.get())) {
}
- bool VerifyReadableRegions(const char** expected, size_t num_expected) {
- iovec iovecs[5];
- size_t num_iovecs = sequencer_->GetReadableRegions(iovecs,
- arraysize(iovecs));
- return VerifyIovecs(iovecs, num_iovecs, expected, num_expected);
- }
-
bool VerifyIovecs(iovec* iovecs,
size_t num_iovecs,
const char** expected,
diff --git a/net/quic/quic_time.cc b/net/quic/quic_time.cc
index 5d653a3..6d31557 100644
--- a/net/quic/quic_time.cc
+++ b/net/quic/quic_time.cc
@@ -173,6 +173,7 @@ QuicWallTime QuicWallTime::Add(QuicTime::Delta delta) const {
return QuicWallTime(seconds);
}
+// TODO(ianswett) Test this.
QuicWallTime QuicWallTime::Subtract(QuicTime::Delta delta) const {
uint64 seconds = seconds_ - delta.ToSeconds();
if (seconds > seconds_) {
diff --git a/net/quic/quic_time_wait_list_manager.cc b/net/quic/quic_time_wait_list_manager.cc
index 2e3e16d..a5384b7 100644
--- a/net/quic/quic_time_wait_list_manager.cc
+++ b/net/quic/quic_time_wait_list_manager.cc
@@ -113,10 +113,8 @@ void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
connection_id_map_.erase(it);
}
TrimTimeWaitListIfNeeded();
- if (FLAGS_quic_limit_time_wait_list_size) {
- DCHECK_LT(num_connections(),
- static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections));
- }
+ DCHECK_LT(num_connections(),
+ static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections));
ConnectionIdData data(num_packets,
version,
helper_->GetClock()->ApproximateNow(),
@@ -291,36 +289,20 @@ bool QuicTimeWaitListManager::MaybeExpireOldestConnection(
void QuicTimeWaitListManager::CleanUpOldConnectionIds() {
QuicTime now = helper_->GetClock()->ApproximateNow();
QuicTime expiration = now.Subtract(kTimeWaitPeriod_);
- if (FLAGS_quic_limit_time_wait_list_size) {
- while (MaybeExpireOldestConnection(expiration)) {
- }
- } else {
- while (!connection_id_map_.empty()) {
- ConnectionIdMap::iterator it = connection_id_map_.begin();
- QuicTime oldest_connection_id = it->second.time_added;
- if (now.Subtract(oldest_connection_id) < kTimeWaitPeriod_) {
- break;
- }
- const QuicConnectionId connection_id = it->first;
- // This connection_id has lived its age, retire it now.
- delete it->second.close_packet;
- connection_id_map_.erase(it);
- visitor_->OnConnectionRemovedFromTimeWaitList(connection_id);
- }
+
+ while (MaybeExpireOldestConnection(expiration)) {
}
SetConnectionIdCleanUpAlarm();
}
void QuicTimeWaitListManager::TrimTimeWaitListIfNeeded() {
- if (FLAGS_quic_limit_time_wait_list_size) {
- if (FLAGS_quic_time_wait_list_max_connections < 0) {
- return;
- }
- while (num_connections() >=
- static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) {
- MaybeExpireOldestConnection(QuicTime::Infinite());
- }
+ if (FLAGS_quic_time_wait_list_max_connections < 0) {
+ return;
+ }
+ while (num_connections() >=
+ static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) {
+ MaybeExpireOldestConnection(QuicTime::Infinite());
}
}
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index be665d2..5f29a2b 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -273,7 +273,7 @@ bool QuicUnackedPacketMap::IsPacketRemovable(
QuicPacketSequenceNumber sequence_number,
const TransmissionInfo& info) const {
return (!IsPacketUsefulForMeasuringRtt(sequence_number, info) ||
- unacked_packets_.size() > kMaxTcpCongestionWindow) &&
+ unacked_packets_.size() > kMaxTrackedPackets / 2) &&
!IsPacketUsefulForCongestionControl(info) &&
!IsPacketUsefulForRetransmittableData(info);
}
diff --git a/net/quic/quic_unacked_packet_map_test.cc b/net/quic/quic_unacked_packet_map_test.cc
index 2077c67..0e1d68a 100644
--- a/net/quic/quic_unacked_packet_map_test.cc
+++ b/net/quic/quic_unacked_packet_map_test.cc
@@ -126,9 +126,9 @@ TEST_F(QuicUnackedPacketMapTest, RttOnly) {
TEST_F(QuicUnackedPacketMapTest, DiscardOldRttOnly) {
// Acks are only tracked for RTT measurement purposes, and are discarded
- // when more than 200 accumulate.
- const size_t kNumUnackedPackets = 200;
- for (size_t i = 1; i < 400; ++i) {
+ // when more than 2500 accumulate.
+ const size_t kNumUnackedPackets = 2500;
+ for (size_t i = 1; i < 3000; ++i) {
unacked_packets_.AddSentPacket(CreateNonRetransmittablePacket(i), 0,
NOT_RETRANSMISSION, now_, kDefaultAckLength,
false);
diff --git a/net/quic/quic_utils.cc b/net/quic/quic_utils.cc
index 17e7461..998f0e0 100644
--- a/net/quic/quic_utils.cc
+++ b/net/quic/quic_utils.cc
@@ -123,15 +123,6 @@ bool QuicUtils::FindMutualTag(const QuicTagVector& our_tags_vector,
}
// static
-void QuicUtils::SerializeUint128(uint128 v, uint8* out) {
- const uint64 lo = Uint128Low64(v);
- const uint64 hi = Uint128High64(v);
- // This assumes that the system is little-endian.
- memcpy(out, &lo, sizeof(lo));
- memcpy(out + sizeof(lo), &hi, sizeof(hi));
-}
-
-// static
void QuicUtils::SerializeUint128Short(uint128 v, uint8* out) {
const uint64 lo = Uint128Low64(v);
const uint64 hi = Uint128High64(v);
@@ -347,11 +338,6 @@ string QuicUtils::StringToHexASCIIDump(StringPiece in_buffer) {
}
// static
-QuicPriority QuicUtils::LowestPriority() {
- return QuicWriteBlockedList::kLowestPriority;
-}
-
-// static
QuicPriority QuicUtils::HighestPriority() {
return QuicWriteBlockedList::kHighestPriority;
}
diff --git a/net/quic/quic_utils.h b/net/quic/quic_utils.h
index 5e76a0d..46652f2 100644
--- a/net/quic/quic_utils.h
+++ b/net/quic/quic_utils.h
@@ -56,9 +56,6 @@ class NET_EXPORT_PRIVATE QuicUtils {
QuicTag* out_result,
size_t* out_index);
- // SerializeUint128 writes |v| in little-endian form to |out|.
- static void SerializeUint128(uint128 v, uint8* out);
-
// SerializeUint128 writes the first 96 bits of |v| in little-endian form
// to |out|.
static void SerializeUint128Short(uint128 v, uint8* out);
@@ -97,8 +94,6 @@ class NET_EXPORT_PRIVATE QuicUtils {
return reinterpret_cast<char*>(data);
}
- static QuicPriority LowestPriority();
-
static QuicPriority HighestPriority();
private:
diff --git a/net/quic/reliable_quic_stream.cc b/net/quic/reliable_quic_stream.cc
index 8f34cf5..c997d6b 100644
--- a/net/quic/reliable_quic_stream.cc
+++ b/net/quic/reliable_quic_stream.cc
@@ -348,27 +348,25 @@ QuicConsumedData ReliableQuicStream::WritevData(
// A FIN with zero data payload should not be flow control blocked.
bool fin_with_zero_data = (fin && write_length == 0);
- if (flow_controller_.IsEnabled()) {
- // How much data we are allowed to write from flow control.
- QuicByteCount send_window = flow_controller_.SendWindowSize();
- if (stream_contributes_to_connection_flow_control_) {
- send_window =
- min(send_window, connection_flow_controller_->SendWindowSize());
- }
+ // How much data we are allowed to write from flow control.
+ QuicByteCount send_window = flow_controller_.SendWindowSize();
+ if (stream_contributes_to_connection_flow_control_) {
+ send_window =
+ min(send_window, connection_flow_controller_->SendWindowSize());
+ }
- if (send_window == 0 && !fin_with_zero_data) {
- // Quick return if we can't send anything.
- MaybeSendBlocked();
- return QuicConsumedData(0, false);
- }
+ if (send_window == 0 && !fin_with_zero_data) {
+ // Quick return if we can't send anything.
+ MaybeSendBlocked();
+ return QuicConsumedData(0, false);
+ }
- if (write_length > send_window) {
- // Don't send the FIN if we aren't going to send all the data.
- fin = false;
+ if (write_length > send_window) {
+ // Don't send the FIN if we aren't going to send all the data.
+ fin = false;
- // Writing more data would be a violation of flow control.
- write_length = static_cast<size_t>(send_window);
- }
+ // Writing more data would be a violation of flow control.
+ write_length = static_cast<size_t>(send_window);
}
// Fill an IOVector with bytes from the iovec.
@@ -458,10 +456,6 @@ void ReliableQuicStream::OnClose() {
void ReliableQuicStream::OnWindowUpdateFrame(
const QuicWindowUpdateFrame& frame) {
- if (!flow_controller_.IsEnabled()) {
- DLOG(DFATAL) << "Flow control not enabled! " << version();
- return;
- }
if (flow_controller_.UpdateSendWindowOffset(frame.byte_offset)) {
// We can write again!
// TODO(rjshade): This does not respect priorities (e.g. multiple
@@ -474,9 +468,6 @@ void ReliableQuicStream::OnWindowUpdateFrame(
bool ReliableQuicStream::MaybeIncreaseHighestReceivedOffset(
QuicStreamOffset new_offset) {
- if (!flow_controller_.IsEnabled()) {
- return false;
- }
uint64 increment =
new_offset - flow_controller_.highest_received_byte_offset();
if (!flow_controller_.UpdateHighestReceivedOffset(new_offset)) {
@@ -495,24 +486,20 @@ bool ReliableQuicStream::MaybeIncreaseHighestReceivedOffset(
}
void ReliableQuicStream::AddBytesSent(QuicByteCount bytes) {
- if (flow_controller_.IsEnabled()) {
- flow_controller_.AddBytesSent(bytes);
- if (stream_contributes_to_connection_flow_control_) {
- connection_flow_controller_->AddBytesSent(bytes);
- }
+ flow_controller_.AddBytesSent(bytes);
+ if (stream_contributes_to_connection_flow_control_) {
+ connection_flow_controller_->AddBytesSent(bytes);
}
}
void ReliableQuicStream::AddBytesConsumed(QuicByteCount bytes) {
- if (flow_controller_.IsEnabled()) {
- // Only adjust stream level flow controller if we are still reading.
- if (!read_side_closed_) {
- flow_controller_.AddBytesConsumed(bytes);
- }
+ // Only adjust stream level flow controller if we are still reading.
+ if (!read_side_closed_) {
+ flow_controller_.AddBytesConsumed(bytes);
+ }
- if (stream_contributes_to_connection_flow_control_) {
- connection_flow_controller_->AddBytesConsumed(bytes);
- }
+ if (stream_contributes_to_connection_flow_control_) {
+ connection_flow_controller_->AddBytesConsumed(bytes);
}
}
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index cecae4b..5073e1e 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -105,10 +105,6 @@ class ReliableQuicStreamTest : public ::testing::TestWithParam<bool> {
"JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo ";
}
- void set_supported_versions(const QuicVersionVector& versions) {
- supported_versions_ = versions;
- }
-
void Initialize(bool stream_should_process_data) {
connection_ =
new StrictMock<MockConnection>(kIsServer, supported_versions_);
diff --git a/net/quic/test_tools/quic_connection_peer.cc b/net/quic/test_tools/quic_connection_peer.cc
index 201d451b..dd75ca8 100644
--- a/net/quic/test_tools/quic_connection_peer.cc
+++ b/net/quic/test_tools/quic_connection_peer.cc
@@ -67,35 +67,12 @@ QuicSentPacketManager* QuicConnectionPeer::GetSentPacketManager(
}
// static
-QuicReceivedPacketManager* QuicConnectionPeer::GetReceivedPacketManager(
- QuicConnection* connection) {
- return &connection->received_packet_manager_;
-}
-
-// static
QuicTime::Delta QuicConnectionPeer::GetNetworkTimeout(
QuicConnection* connection) {
return connection->idle_network_timeout_;
}
// static
-bool QuicConnectionPeer::IsSavedForRetransmission(
- QuicConnection* connection,
- QuicPacketSequenceNumber sequence_number) {
- return connection->sent_packet_manager_.IsUnacked(sequence_number) &&
- connection->sent_packet_manager_.HasRetransmittableFrames(
- sequence_number);
-}
-
-// static
-bool QuicConnectionPeer::IsRetransmission(
- QuicConnection* connection,
- QuicPacketSequenceNumber sequence_number) {
- return QuicSentPacketManagerPeer::IsRetransmission(
- &connection->sent_packet_manager_, sequence_number);
-}
-
-// static
// TODO(ianswett): Create a GetSentEntropyHash which accepts an AckFrame.
QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash(
QuicConnection* connection,
@@ -240,12 +217,6 @@ QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket(
}
// static
-void QuicConnectionPeer::SetSupportedVersions(QuicConnection* connection,
- QuicVersionVector versions) {
- connection->framer_.SetSupportedVersions(versions);
-}
-
-// static
QuicPacketHeader* QuicConnectionPeer::GetLastHeader(
QuicConnection* connection) {
return &connection->last_header_;
diff --git a/net/quic/test_tools/quic_connection_peer.h b/net/quic/test_tools/quic_connection_peer.h
index 086e353..6746338 100644
--- a/net/quic/test_tools/quic_connection_peer.h
+++ b/net/quic/test_tools/quic_connection_peer.h
@@ -53,18 +53,8 @@ class QuicConnectionPeer {
static QuicSentPacketManager* GetSentPacketManager(
QuicConnection* connection);
- static QuicReceivedPacketManager* GetReceivedPacketManager(
- QuicConnection* connection);
-
static QuicTime::Delta GetNetworkTimeout(QuicConnection* connection);
- static bool IsSavedForRetransmission(
- QuicConnection* connection,
- QuicPacketSequenceNumber sequence_number);
-
- static bool IsRetransmission(QuicConnection* connection,
- QuicPacketSequenceNumber sequence_number);
-
static QuicPacketEntropyHash GetSentEntropyHash(
QuicConnection* connection,
QuicPacketSequenceNumber sequence_number);
@@ -115,9 +105,6 @@ class QuicConnectionPeer {
static QuicEncryptedPacket* GetConnectionClosePacket(
QuicConnection* connection);
- static void SetSupportedVersions(QuicConnection* connection,
- QuicVersionVector versions);
-
static QuicPacketHeader* GetLastHeader(QuicConnection* connection);
static void SetSequenceNumberOfLastSentPacket(
diff --git a/net/quic/test_tools/quic_sent_packet_manager_peer.cc b/net/quic/test_tools/quic_sent_packet_manager_peer.cc
index 4e182ab..c50a171 100644
--- a/net/quic/test_tools/quic_sent_packet_manager_peer.cc
+++ b/net/quic/test_tools/quic_sent_packet_manager_peer.cc
@@ -78,20 +78,6 @@ RttStats* QuicSentPacketManagerPeer::GetRttStats(
}
// static
-QuicPacketCount QuicSentPacketManagerPeer::GetNackCount(
- const QuicSentPacketManager* sent_packet_manager,
- QuicPacketSequenceNumber sequence_number) {
- return sent_packet_manager->unacked_packets_.
- GetTransmissionInfo(sequence_number).nack_count;
-}
-
-// static
-size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount(
- const QuicSentPacketManager* sent_packet_manager) {
- return sent_packet_manager->pending_retransmissions_.size();
-}
-
-// static
bool QuicSentPacketManagerPeer::HasPendingPackets(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->unacked_packets_.HasInFlightPackets();
diff --git a/net/quic/test_tools/quic_sent_packet_manager_peer.h b/net/quic/test_tools/quic_sent_packet_manager_peer.h
index 6ac34ffc..3543a1b 100644
--- a/net/quic/test_tools/quic_sent_packet_manager_peer.h
+++ b/net/quic/test_tools/quic_sent_packet_manager_peer.h
@@ -44,13 +44,6 @@ class QuicSentPacketManagerPeer {
static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
- static QuicPacketCount GetNackCount(
- const QuicSentPacketManager* sent_packet_manager,
- QuicPacketSequenceNumber sequence_number);
-
- static size_t GetPendingRetransmissionCount(
- const QuicSentPacketManager* sent_packet_manager);
-
static bool HasPendingPackets(
const QuicSentPacketManager* sent_packet_manager);
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h
index 5282d62..900bb15 100644
--- a/net/quic/test_tools/quic_test_utils.h
+++ b/net/quic/test_tools/quic_test_utils.h
@@ -42,7 +42,6 @@ static const uint32 kInitialSessionFlowControlWindowForTest =
static const QuicStreamId kClientDataStreamId1 = 5;
static const QuicStreamId kClientDataStreamId2 = 7;
static const QuicStreamId kClientDataStreamId3 = 9;
-static const QuicStreamId kClientDataStreamId4 = 11;
// Returns the test peer IP address.
IPAddressNumber TestPeerIPAddress();
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc
index f9f37ad..431f446 100644
--- a/net/quic/test_tools/simple_quic_framer.cc
+++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -208,10 +208,6 @@ SimpleQuicFramer::version_negotiation_packet() const {
return visitor_->version_negotiation_packet();
}
-const QuicPublicResetPacket* SimpleQuicFramer::public_reset_packet() const {
- return visitor_->public_reset_packet();
-}
-
QuicFramer* SimpleQuicFramer::framer() {
return &framer_;
}
diff --git a/net/quic/test_tools/simple_quic_framer.h b/net/quic/test_tools/simple_quic_framer.h
index 4e2ed31..aab23ff 100644
--- a/net/quic/test_tools/simple_quic_framer.h
+++ b/net/quic/test_tools/simple_quic_framer.h
@@ -48,7 +48,6 @@ class SimpleQuicFramer {
const std::vector<QuicStreamFrame>& stream_frames() const;
const QuicFecData& fec_data() const;
const QuicVersionNegotiationPacket* version_negotiation_packet() const;
- const QuicPublicResetPacket* public_reset_packet() const;
QuicFramer* framer();
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc
index 8f19cf4..9921940 100644
--- a/net/tools/quic/quic_dispatcher.cc
+++ b/net/tools/quic/quic_dispatcher.cc
@@ -372,28 +372,17 @@ QuicSession* QuicDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
const IPEndPoint& server_address,
const IPEndPoint& client_address) {
- QuicServerSession* session = new QuicServerSession(
- config_,
- CreateQuicConnection(connection_id, server_address, client_address),
- this);
+ // The QuicSession takes ownership of |connection| below.
+ QuicConnection* connection = new QuicConnection(
+ connection_id, client_address, helper_.get(), connection_writer_factory_,
+ /* owns_writer= */ true, /* is_server= */ true,
+ crypto_config_.HasProofSource(), supported_versions_);
+
+ QuicServerSession* session = new QuicServerSession(config_, connection, this);
session->InitializeSession(crypto_config_);
return session;
}
-QuicConnection* QuicDispatcher::CreateQuicConnection(
- QuicConnectionId connection_id,
- const IPEndPoint& server_address,
- const IPEndPoint& client_address) {
- return new QuicConnection(connection_id,
- client_address,
- helper_.get(),
- connection_writer_factory_,
- /* owns_writer= */ true,
- /* is_server= */ true,
- crypto_config_.HasProofSource(),
- supported_versions_);
-}
-
QuicTimeWaitListManager* QuicDispatcher::CreateQuicTimeWaitListManager() {
return new QuicTimeWaitListManager(
writer_.get(), this, epoll_server(), supported_versions());
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index 36e711a..4b3fe0a 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -135,11 +135,6 @@ class QuicDispatcher : public QuicServerSessionVisitor,
const IPEndPoint& server_address,
const IPEndPoint& client_address);
- virtual QuicConnection* CreateQuicConnection(
- QuicConnectionId connection_id,
- const IPEndPoint& server_address,
- const IPEndPoint& client_address);
-
// Called by |framer_visitor_| when the public header has been parsed.
virtual bool OnUnauthenticatedPublicHeader(
const QuicPacketPublicHeader& header);
@@ -148,11 +143,6 @@ class QuicDispatcher : public QuicServerSessionVisitor,
// will be owned by the dispatcher as time_wait_list_manager_
virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager();
- // Replaces the packet writer with |writer|. Takes ownership of |writer|.
- void set_writer(QuicPacketWriter* writer) {
- writer_.reset(writer);
- }
-
QuicTimeWaitListManager* time_wait_list_manager() {
return time_wait_list_manager_.get();
}
diff --git a/net/tools/quic/quic_packet_writer_wrapper.cc b/net/tools/quic/quic_packet_writer_wrapper.cc
index 3d1b03d..3befce9 100644
--- a/net/tools/quic/quic_packet_writer_wrapper.cc
+++ b/net/tools/quic/quic_packet_writer_wrapper.cc
@@ -40,9 +40,5 @@ void QuicPacketWriterWrapper::set_writer(QuicPacketWriter* writer) {
writer_.reset(writer);
}
-QuicPacketWriter* QuicPacketWriterWrapper::release_writer() {
- return writer_.release();
-}
-
} // namespace tools
} // namespace net
diff --git a/net/tools/quic/quic_packet_writer_wrapper.h b/net/tools/quic/quic_packet_writer_wrapper.h
index a8b819c..ca366b5 100644
--- a/net/tools/quic/quic_packet_writer_wrapper.h
+++ b/net/tools/quic/quic_packet_writer_wrapper.h
@@ -34,9 +34,6 @@ class QuicPacketWriterWrapper : public net::QuicPacketWriter {
// Takes ownership of |writer|.
void set_writer(QuicPacketWriter* writer);
- // Releases ownership of |writer_|.
- QuicPacketWriter* release_writer();
-
private:
scoped_ptr<QuicPacketWriter> writer_;
diff --git a/net/tools/quic/quic_server.h b/net/tools/quic/quic_server.h
index 31e5988..7c50371 100644
--- a/net/tools/quic/quic_server.h
+++ b/net/tools/quic/quic_server.h
@@ -133,10 +133,6 @@ class QuicServer : public EpollCallbackInterface {
// skipped as necessary).
QuicVersionVector supported_versions_;
- // Size of flow control receive window to advertise to clients on new
- // connections.
- uint32 server_initial_flow_control_receive_window_;
-
DISALLOW_COPY_AND_ASSIGN(QuicServer);
};
diff --git a/net/tools/quic/quic_server_session_test.cc b/net/tools/quic/quic_server_session_test.cc
index 71c2b42..8074d31 100644
--- a/net/tools/quic/quic_server_session_test.cc
+++ b/net/tools/quic/quic_server_session_test.cc
@@ -36,7 +36,6 @@ using net::test::ValueRestore;
using net::test::kClientDataStreamId1;
using net::test::kClientDataStreamId2;
using net::test::kClientDataStreamId3;
-using net::test::kClientDataStreamId4;
using std::string;
using testing::StrictMock;
using testing::_;
@@ -51,9 +50,6 @@ class QuicServerSessionPeer {
QuicServerSession* s, QuicStreamId id) {
return s->GetIncomingDataStream(id);
}
- static QuicDataStream* GetDataStream(QuicServerSession* s, QuicStreamId id) {
- return s->GetDataStream(id);
- }
static void SetCryptoStream(QuicServerSession* s,
QuicCryptoServerStream* crypto_stream) {
s->crypto_stream_.reset(crypto_stream);
@@ -87,8 +83,6 @@ class QuicServerSessionTest : public ::testing::TestWithParam<QuicVersion> {
visitor_ = QuicConnectionPeer::GetVisitor(connection_);
}
- QuicVersion version() const { return connection_->version(); }
-
StrictMock<MockQuicServerSessionVisitor> owner_;
StrictMock<MockConnection>* connection_;
QuicConfig config_;
diff --git a/net/tools/quic/quic_time_wait_list_manager.cc b/net/tools/quic/quic_time_wait_list_manager.cc
index c9e589c..98f96ec 100644
--- a/net/tools/quic/quic_time_wait_list_manager.cc
+++ b/net/tools/quic/quic_time_wait_list_manager.cc
@@ -118,10 +118,8 @@ void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
connection_id_map_.erase(it);
}
TrimTimeWaitListIfNeeded();
- if (FLAGS_quic_limit_time_wait_list_size) {
- DCHECK_LT(num_connections(),
- static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections));
- }
+ DCHECK_LT(num_connections(),
+ static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections));
ConnectionIdData data(num_packets,
version,
clock_.ApproximateNow(),
@@ -300,36 +298,20 @@ bool QuicTimeWaitListManager::MaybeExpireOldestConnection(
void QuicTimeWaitListManager::CleanUpOldConnectionIds() {
QuicTime now = clock_.ApproximateNow();
QuicTime expiration = now.Subtract(kTimeWaitPeriod_);
- if (FLAGS_quic_limit_time_wait_list_size) {
- while (MaybeExpireOldestConnection(expiration)) {
- }
- } else {
- while (!connection_id_map_.empty()) {
- ConnectionIdMap::iterator it = connection_id_map_.begin();
- QuicTime oldest_connection_id = it->second.time_added;
- if (now.Subtract(oldest_connection_id) < kTimeWaitPeriod_) {
- break;
- }
- const QuicConnectionId connection_id = it->first;
- // This connection_id has lived its age, retire it now.
- delete it->second.close_packet;
- connection_id_map_.erase(it);
- visitor_->OnConnectionRemovedFromTimeWaitList(connection_id);
- }
+
+ while (MaybeExpireOldestConnection(expiration)) {
}
SetConnectionIdCleanUpAlarm();
}
void QuicTimeWaitListManager::TrimTimeWaitListIfNeeded() {
- if (FLAGS_quic_limit_time_wait_list_size) {
- if (FLAGS_quic_time_wait_list_max_connections < 0) {
- return;
- }
- while (num_connections() >=
- static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) {
- MaybeExpireOldestConnection(QuicTime::Infinite());
- }
+ if (FLAGS_quic_time_wait_list_max_connections < 0) {
+ return;
+ }
+ while (num_connections() >=
+ static_cast<size_t>(FLAGS_quic_time_wait_list_max_connections)) {
+ MaybeExpireOldestConnection(QuicTime::Infinite());
}
}
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc
index bddcc17..f67fe7e 100644
--- a/net/tools/quic/quic_time_wait_list_manager_test.cc
+++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -488,7 +488,6 @@ TEST_F(QuicTimeWaitListManagerTest, ConnectionIdsOrderedByTime) {
}
TEST_F(QuicTimeWaitListManagerTest, MaxConnectionsTest) {
- ValueRestore<bool> old_flag(&FLAGS_quic_limit_time_wait_list_size, true);
// Basically, shut off time-based eviction.
FLAGS_quic_time_wait_list_seconds = 10000000000;
FLAGS_quic_time_wait_list_max_connections = 5;
diff --git a/net/tools/quic/test_tools/packet_dropping_test_writer.h b/net/tools/quic/test_tools/packet_dropping_test_writer.h
index cdd8efc..b39539f 100644
--- a/net/tools/quic/test_tools/packet_dropping_test_writer.h
+++ b/net/tools/quic/test_tools/packet_dropping_test_writer.h
@@ -104,6 +104,7 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
buffer_size_ = buffer_size;
}
+ // Useful for reproducing very flaky issues.
void set_seed(uint64 seed) {
simple_random_.set_seed(seed);
}
diff --git a/net/tools/quic/test_tools/quic_dispatcher_peer.cc b/net/tools/quic/test_tools/quic_dispatcher_peer.cc
index 1900420..5d3ce7a 100644
--- a/net/tools/quic/test_tools/quic_dispatcher_peer.cc
+++ b/net/tools/quic/test_tools/quic_dispatcher_peer.cc
@@ -44,17 +44,6 @@ QuicEpollConnectionHelper* QuicDispatcherPeer::GetHelper(
}
// static
-QuicConnection* QuicDispatcherPeer::CreateQuicConnection(
- QuicDispatcher* dispatcher,
- QuicConnectionId connection_id,
- const IPEndPoint& server,
- const IPEndPoint& client) {
- return dispatcher->CreateQuicConnection(connection_id,
- server,
- client);
-}
-
-// static
QuicDispatcher::WriteBlockedList* QuicDispatcherPeer::GetWriteBlockedList(
QuicDispatcher* dispatcher) {
return &dispatcher->write_blocked_list_;
diff --git a/net/tools/quic/test_tools/quic_dispatcher_peer.h b/net/tools/quic/test_tools/quic_dispatcher_peer.h
index 6271615..e5edf16 100644
--- a/net/tools/quic/test_tools/quic_dispatcher_peer.h
+++ b/net/tools/quic/test_tools/quic_dispatcher_peer.h
@@ -34,12 +34,6 @@ class QuicDispatcherPeer {
static QuicEpollConnectionHelper* GetHelper(QuicDispatcher* dispatcher);
- static QuicConnection* CreateQuicConnection(
- QuicDispatcher* dispatcher,
- QuicConnectionId connection_id,
- const IPEndPoint& server,
- const IPEndPoint& client);
-
static QuicDispatcher::WriteBlockedList* GetWriteBlockedList(
QuicDispatcher* dispatcher);