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

Side by Side Diff: net/quic/quic_spdy_stream.cc

Issue 1433063002: Override ReliableQuicStream::StopReading() to send RST_STREAM+NO_ERROR if CloseWriteSide() is calle… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106978852
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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_spdy_stream.h" 5 #include "net/quic/quic_spdy_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/quic_spdy_session.h" 8 #include "net/quic/quic_spdy_session.h"
9 #include "net/quic/quic_utils.h" 9 #include "net/quic/quic_utils.h"
10 #include "net/quic/quic_write_blocked_list.h" 10 #include "net/quic/quic_write_blocked_list.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 sequencer()->ignore_read_data() && !rst_sent()) { 47 sequencer()->ignore_read_data() && !rst_sent()) {
48 DCHECK(fin_sent()); 48 DCHECK(fin_sent());
49 // Tell the peer to stop sending further data. 49 // Tell the peer to stop sending further data.
50 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); 50 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id();
51 Reset(QUIC_STREAM_NO_ERROR); 51 Reset(QUIC_STREAM_NO_ERROR);
52 } 52 }
53 53
54 ReliableQuicStream::CloseWriteSide(); 54 ReliableQuicStream::CloseWriteSide();
55 } 55 }
56 56
57 void QuicSpdyStream::StopReading() {
58 if (version() > QUIC_VERSION_28 && !fin_received() && !rst_received() &&
59 write_side_closed() && !rst_sent()) {
60 DCHECK(fin_sent());
61 // Tell the peer to stop sending further data.
62 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id();
63 Reset(QUIC_STREAM_NO_ERROR);
64 }
65 ReliableQuicStream::StopReading();
66 }
67
57 size_t QuicSpdyStream::WriteHeaders( 68 size_t QuicSpdyStream::WriteHeaders(
58 const SpdyHeaderBlock& header_block, 69 const SpdyHeaderBlock& header_block,
59 bool fin, 70 bool fin,
60 QuicAckListenerInterface* ack_notifier_delegate) { 71 QuicAckListenerInterface* ack_notifier_delegate) {
61 size_t bytes_written = spdy_session_->WriteHeaders( 72 size_t bytes_written = spdy_session_->WriteHeaders(
62 id(), header_block, fin, priority_, ack_notifier_delegate); 73 id(), header_block, fin, priority_, ack_notifier_delegate);
63 if (fin) { 74 if (fin) {
64 // TODO(rch): Add test to ensure fin_sent_ is set whenever a fin is sent. 75 // TODO(rch): Add test to ensure fin_sent_ is set whenever a fin is sent.
65 set_fin_sent(true); 76 set_fin_sent(true);
66 CloseWriteSide(); 77 CloseWriteSide();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 visitor_ = nullptr; 163 visitor_ = nullptr;
153 visitor->OnClose(this); 164 visitor->OnClose(this);
154 } 165 }
155 } 166 }
156 167
157 bool QuicSpdyStream::FinishedReadingHeaders() const { 168 bool QuicSpdyStream::FinishedReadingHeaders() const {
158 return headers_decompressed_ && decompressed_headers_.empty(); 169 return headers_decompressed_ && decompressed_headers_.empty();
159 } 170 }
160 171
161 } // namespace net 172 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/tools/quic/quic_spdy_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698