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

Unified Diff: net/quic/quic_connection.cc

Issue 1782053003: Optionally defer responding to a QUIC ACK until all ACK processing has completed for an EpollServer… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@115992556
Patch Set: Created 4 years, 9 months 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/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 46636fae13f9e6ec0be2b186b3a860d950578baa..75640a3fd9dd6a3658b6d6b4d3928a9883c32fb3 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -129,7 +129,7 @@ class SendAlarm : public QuicAlarm::Delegate {
explicit SendAlarm(QuicConnection* connection) : connection_(connection) {}
QuicTime OnAlarm() override {
- connection_->WriteIfNotBlocked();
+ connection_->WriteAndBundleAcksIfNotBlocked();
// Never reschedule the alarm, since CanWrite does that.
return QuicTime::Zero();
}
@@ -284,6 +284,7 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
ack_mode_(TCP_ACKING),
delay_setting_retransmission_alarm_(false),
pending_retransmission_alarm_(false),
+ defer_send_in_response_to_packets_(false),
arena_(),
ack_alarm_(helper->CreateAlarm(arena_.New<AckAlarm>(this), &arena_)),
retransmission_alarm_(
@@ -1135,11 +1136,14 @@ void QuicConnection::MaybeSendInResponseToPacket() {
if (!connected_) {
return;
}
- ScopedPacketBundler bundler(this, ack_queued_ ? SEND_ACK : NO_ACK);
-
// Now that we have received an ack, we might be able to send packets which
// are queued locally, or drain streams which are blocked.
- WriteIfNotBlocked();
+ if (defer_send_in_response_to_packets_) {
+ send_alarm_->Cancel();
+ send_alarm_->Set(clock_->ApproximateNow());
+ } else {
+ WriteAndBundleAcksIfNotBlocked();
+ }
}
void QuicConnection::SendVersionNegotiationPacket() {
@@ -1400,6 +1404,13 @@ void QuicConnection::WriteIfNotBlocked() {
}
}
+void QuicConnection::WriteAndBundleAcksIfNotBlocked() {
+ if (!writer_->IsWriteBlocked()) {
+ ScopedPacketBundler bundler(this, ack_queued_ ? SEND_ACK : NO_ACK);
+ OnCanWrite();
+ }
+}
+
bool QuicConnection::ProcessValidatedPacket(const QuicPacketHeader& header) {
if (FLAGS_check_peer_address_change_after_decryption) {
if (perspective_ == Perspective::IS_SERVER &&
« no previous file with comments | « net/quic/quic_connection.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698