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

Side by Side Diff: net/quic/quic_connection.cc

Issue 285193006: Don't set QUIC's write alarm if we are connection flow control blocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 } 1150 }
1151 1151
1152 { // Limit the scope of the bundler. 1152 { // Limit the scope of the bundler.
1153 // Set |include_ack| to false in bundler; ack inclusion happens elsewhere. 1153 // Set |include_ack| to false in bundler; ack inclusion happens elsewhere.
1154 ScopedPacketBundler bundler(this, NO_ACK); 1154 ScopedPacketBundler bundler(this, NO_ACK);
1155 visitor_->OnCanWrite(); 1155 visitor_->OnCanWrite();
1156 } 1156 }
1157 1157
1158 // After the visitor writes, it may have caused the socket to become write 1158 // After the visitor writes, it may have caused the socket to become write
1159 // blocked or the congestion manager to prohibit sending, so check again. 1159 // blocked or the congestion manager to prohibit sending, so check again.
1160 if (visitor_->HasPendingWrites() && !resume_writes_alarm_->IsSet() && 1160 if (visitor_->WillingAndAbleToWrite() &&
1161 !resume_writes_alarm_->IsSet() &&
1161 CanWrite(NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA)) { 1162 CanWrite(NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA)) {
1162 // We're not write blocked, but some stream didn't write out all of its 1163 // We're not write blocked, but some stream didn't write out all of its
1163 // bytes. Register for 'immediate' resumption so we'll keep writing after 1164 // bytes. Register for 'immediate' resumption so we'll keep writing after
1164 // other connections and events have had a chance to use the thread. 1165 // other connections and events have had a chance to use the thread.
1165 resume_writes_alarm_->Set(clock_->ApproximateNow()); 1166 resume_writes_alarm_->Set(clock_->ApproximateNow());
1166 } 1167 }
1167 } 1168 }
1168 1169
1169 void QuicConnection::WriteIfNotBlocked() { 1170 void QuicConnection::WriteIfNotBlocked() {
1170 if (!writer_->IsWriteBlocked()) { 1171 if (!writer_->IsWriteBlocked()) {
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 // If we changed the generator's batch state, restore original batch state. 1963 // If we changed the generator's batch state, restore original batch state.
1963 if (!already_in_batch_mode_) { 1964 if (!already_in_batch_mode_) {
1964 DVLOG(1) << "Leaving Batch Mode."; 1965 DVLOG(1) << "Leaving Batch Mode.";
1965 connection_->packet_generator_.FinishBatchOperations(); 1966 connection_->packet_generator_.FinishBatchOperations();
1966 } 1967 }
1967 DCHECK_EQ(already_in_batch_mode_, 1968 DCHECK_EQ(already_in_batch_mode_,
1968 connection_->packet_generator_.InBatchMode()); 1969 connection_->packet_generator_.InBatchMode());
1969 } 1970 }
1970 1971
1971 } // namespace net 1972 } // namespace net
OLDNEW
« 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