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

Unified Diff: net/quic/quic_connection.cc

Issue 1507853003: Reland of Close the QUIC connection when non-crypto stream data is written at ENCRYPTION_NONE. Flag protected… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years 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 | « no previous file | 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 261230b062acfa0bdaf088301192237cbe72a5ff..a3fa3d933137f97ad5bf872ca6d63e5e01da93b0 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1132,6 +1132,12 @@
LOG(DFATAL) << "Attempt to send empty stream frame";
return QuicConsumedData(0, false);
}
+ if (FLAGS_quic_never_write_unencrypted_data && id != kCryptoStreamId &&
+ encryption_level_ == ENCRYPTION_NONE) {
+ LOG(DFATAL) << "Cannot send stream data without encryption.";
+ CloseConnection(QUIC_UNENCRYPTED_STREAM_DATA, false);
+ return QuicConsumedData(0, false);
+ }
// Opportunistically bundle an ack with every outgoing packet.
// Particularly, we want to bundle with handshake packets since we don't know
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698