| Index: net/quic/quic_connection.cc
|
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
|
| index de6515b723a6d5e0600b94e7743889a06794f5ba..4132cec8ba6fb5e9c4b44dfcb58eb0da8aeba2f3 100644
|
| --- a/net/quic/quic_connection.cc
|
| +++ b/net/quic/quic_connection.cc
|
| @@ -1364,7 +1364,11 @@ void QuicConnection::OnCanWrite() {
|
| // We're not write blocked, but some stream didn't write out all of its
|
| // bytes. Register for 'immediate' resumption so we'll keep writing after
|
| // other connections and events have had a chance to use the thread.
|
| - resume_writes_alarm_->Set(clock_->ApproximateNow());
|
| + if (FLAGS_quic_only_one_sending_alarm) {
|
| + send_alarm_->Update(clock_->ApproximateNow(), QuicTime::Delta::Zero());
|
| + } else {
|
| + resume_writes_alarm_->Set(clock_->ApproximateNow());
|
| + }
|
| }
|
| }
|
|
|
| @@ -1855,6 +1859,10 @@ void QuicConnection::OnRetransmissionTimeout() {
|
| return;
|
| }
|
|
|
| + // Cancel the send alarm to ensure TimeUntilSend is re-evaluated.
|
| + if (FLAGS_quic_only_one_sending_alarm) {
|
| + send_alarm_->Cancel();
|
| + }
|
| sent_packet_manager_.OnRetransmissionTimeout();
|
| WriteIfNotBlocked();
|
|
|
| @@ -2176,6 +2184,19 @@ void QuicConnection::SetRetransmissionAlarm() {
|
| pending_retransmission_alarm_ = true;
|
| return;
|
| }
|
| + // Once the handshake has been confirmed, the retransmission alarm should
|
| + // never fire before the send alarm.
|
| + if (FLAGS_quic_only_one_sending_alarm &&
|
| + sent_packet_manager_.handshake_confirmed() && send_alarm_->IsSet()) {
|
| + DCHECK(!sent_packet_manager_.GetRetransmissionTime().IsInitialized() ||
|
| + sent_packet_manager_.GetRetransmissionTime() >=
|
| + send_alarm_->deadline())
|
| + << " retransmission_time:"
|
| + << sent_packet_manager_.GetRetransmissionTime().ToDebuggingValue()
|
| + << " send_alarm:" << send_alarm_->deadline().ToDebuggingValue();
|
| + retransmission_alarm_->Cancel();
|
| + return;
|
| + }
|
| QuicTime retransmission_time = sent_packet_manager_.GetRetransmissionTime();
|
| retransmission_alarm_->Update(retransmission_time,
|
| QuicTime::Delta::FromMilliseconds(1));
|
|
|