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

Unified Diff: net/quic/quic_dispatcher.cc

Issue 355573007: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added NET_EXPORT_PRIVATE for ContainsQuicTag Created 6 years, 6 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_dispatcher.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_dispatcher.cc
diff --git a/net/quic/quic_dispatcher.cc b/net/quic/quic_dispatcher.cc
index ffdce7c9286214c57e85fe6d942b300d573d3a0e..ae964edc8df878d2a30a53adae57d71d5946959f 100644
--- a/net/quic/quic_dispatcher.cc
+++ b/net/quic/quic_dispatcher.cc
@@ -292,8 +292,8 @@ void QuicDispatcher::OnCanWrite() {
// We finished a write: the socket should not be blocked.
writer_->SetWritable();
- // Let all the blocked writers try to write, until we're blocked again or
- // there's no work left.
+ // Give all the blocked writers one chance to write, until we're blocked again
+ // or there's no work left.
while (!write_blocked_list_.empty() && !writer_->IsWriteBlocked()) {
QuicBlockedWriterInterface* blocked_writer =
write_blocked_list_.begin()->first;
@@ -337,9 +337,16 @@ void QuicDispatcher::OnConnectionClosed(QuicConnectionId connection_id,
CleanUpSession(it);
}
-void QuicDispatcher::OnWriteBlocked(QuicBlockedWriterInterface* writer) {
- DCHECK(writer_->IsWriteBlocked());
- write_blocked_list_.insert(make_pair(writer, true));
+void QuicDispatcher::OnWriteBlocked(
+ QuicBlockedWriterInterface* blocked_writer) {
+ if (!writer_->IsWriteBlocked()) {
+ LOG(DFATAL) <<
+ "QuicDispatcher::OnWriteBlocked called when the writer is not blocked.";
+ // Return without adding the connection to the blocked list, to avoid
+ // infinite loops in OnCanWrite.
+ return;
+ }
+ write_blocked_list_.insert(make_pair(blocked_writer, true));
}
QuicSession* QuicDispatcher::CreateQuicSession(
« no previous file with comments | « net/quic/quic_dispatcher.h ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698