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

Unified Diff: net/quic/quic_spdy_stream.cc

Issue 1413373013: Quic streams honor RST_STREAM + NO_ERROR on the write side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106851267
Patch Set: Created 5 years, 1 month 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_spdy_stream.h ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_stream.cc
diff --git a/net/quic/quic_spdy_stream.cc b/net/quic/quic_spdy_stream.cc
index 746e96a8841bc36c0fa0d1253b8a3680f1c79d2e..6a835f81379361073498f9f5c26d78184d223b20 100644
--- a/net/quic/quic_spdy_stream.cc
+++ b/net/quic/quic_spdy_stream.cc
@@ -14,6 +14,10 @@ using std::min;
namespace net {
+#define ENDPOINT \
+ (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \
+ " ")
+
namespace {
// This is somewhat arbitrary. It's possible, but unlikely, we will either fail
@@ -38,6 +42,18 @@ QuicSpdyStream::QuicSpdyStream(QuicStreamId id, QuicSpdySession* spdy_session)
QuicSpdyStream::~QuicSpdyStream() {}
+void QuicSpdyStream::CloseWriteSide() {
+ if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() &&
+ sequencer()->ignore_read_data() && !rst_sent()) {
+ DCHECK(fin_sent());
+ // Tell the peer to stop sending further data.
+ DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id();
+ Reset(QUIC_STREAM_NO_ERROR);
+ }
+
+ ReliableQuicStream::CloseWriteSide();
+}
+
size_t QuicSpdyStream::WriteHeaders(
const SpdyHeaderBlock& header_block,
bool fin,
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/quic/reliable_quic_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698