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

Unified Diff: net/quic/chromium/quic_chromium_client_stream.cc

Issue 2393233002: Remove OnDataAvailable() notification when trailers are to be delivered (Closed)
Patch Set: Address Andrei's comments Created 4 years, 2 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
Index: net/quic/chromium/quic_chromium_client_stream.cc
diff --git a/net/quic/chromium/quic_chromium_client_stream.cc b/net/quic/chromium/quic_chromium_client_stream.cc
index 049668e38a18d1fbbfa8c0506286441a20ee984e..e80f0fc7c14210e35983a44da308eb593deea536 100644
--- a/net/quic/chromium/quic_chromium_client_stream.cc
+++ b/net/quic/chromium/quic_chromium_client_stream.cc
@@ -136,6 +136,12 @@ void QuicChromiumClientStream::OnDataAvailable() {
return;
}
+ if (!sequencer()->HasBytesToRead() && !FinishedReadingTrailers()) {
+ // If there is no data to read, wait until either FIN is received or
+ // trailers are delivered.
+ return;
+ }
+
// The delegate will read the data via a posted task, and
// will be able to, potentially, read all data which has queued up.
NotifyDelegateOfDataAvailableLater();

Powered by Google App Engine
This is Rietveld 408576698