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

Unified Diff: net/tools/quic/quic_spdy_server_stream_base.cc

Issue 2537773006: Extract a QuicSpdyServerStreamBase class for code sharing between QuicSimpleServerStream and GfeQui… (Closed)
Patch Set: Created 4 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
Index: net/tools/quic/quic_spdy_server_stream_base.cc
diff --git a/net/tools/quic/quic_spdy_server_stream_base.cc b/net/tools/quic/quic_spdy_server_stream_base.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1f5244d9ddb4830248872507a2f35f70cca9ea19
--- /dev/null
+++ b/net/tools/quic/quic_spdy_server_stream_base.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/tools/quic/quic_spdy_server_stream_base.h"
+
+#include "net/quic/core/quic_error_codes.h"
+
+namespace net {
+
+QuicSpdyServerStreamBase::QuicSpdyServerStreamBase(QuicStreamId id,
+ QuicSpdySession* session)
+ : QuicSpdyStream(id, session) {}
+
+void QuicSpdyServerStreamBase::CloseWriteSide() {
+ LOG(ERROR) << "CloseWriteSide()";
+ if (!fin_received() && !rst_received() && sequencer()->ignore_read_data() &&
+ !rst_sent()) {
+ // Early cancel the stream if it has stopped reading before receiving FIN
+ // or RST.
+ DCHECK(fin_sent());
+ // Tell the peer to stop sending further data.
+ DVLOG(0) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id();
+ Reset(QUIC_STREAM_NO_ERROR);
+ }
+
+ QuicSpdyStream::CloseWriteSide();
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698