| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/tools/quic/quic_spdy_server_stream_base.h" | 5 #include "net/tools/quic/quic_spdy_server_stream_base.h" |
| 6 | 6 |
| 7 #include "net/quic/core/quic_error_codes.h" | 7 #include "net/quic/core/quic_error_codes.h" |
| 8 #include "net/quic/platform/api/quic_logging.h" | 8 #include "net/quic/platform/api/quic_logging.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 QuicSpdyServerStreamBase::QuicSpdyServerStreamBase(QuicStreamId id, | 12 QuicSpdyServerStreamBase::QuicSpdyServerStreamBase(QuicStreamId id, |
| 13 QuicSpdySession* session) | 13 QuicSpdySession* session) |
| 14 : QuicSpdyStream(id, session) {} | 14 : QuicSpdyStream(id, session) {} |
| 15 | 15 |
| 16 void QuicSpdyServerStreamBase::CloseWriteSide() { | 16 void QuicSpdyServerStreamBase::CloseWriteSide() { |
| 17 if (!fin_received() && !rst_received() && sequencer()->ignore_read_data() && | 17 if (!fin_received() && !rst_received() && sequencer()->ignore_read_data() && |
| 18 !rst_sent()) { | 18 !rst_sent()) { |
| 19 // Early cancel the stream if it has stopped reading before receiving FIN | 19 // Early cancel the stream if it has stopped reading before receiving FIN |
| 20 // or RST. | 20 // or RST. |
| 21 DCHECK(fin_sent()); | 21 DCHECK(fin_sent()); |
| 22 // Tell the peer to stop sending further data. | 22 // Tell the peer to stop sending further data. |
| 23 QUIC_DVLOG(0) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id(); | 23 QUIC_DVLOG(1) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id(); |
| 24 Reset(QUIC_STREAM_NO_ERROR); | 24 Reset(QUIC_STREAM_NO_ERROR); |
| 25 } | 25 } |
| 26 | 26 |
| 27 QuicSpdyStream::CloseWriteSide(); | 27 QuicSpdyStream::CloseWriteSide(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void QuicSpdyServerStreamBase::StopReading() { |
| 31 if (!fin_received() && !rst_received() && write_side_closed() && |
| 32 !rst_sent()) { |
| 33 DCHECK(fin_sent()); |
| 34 // Tell the peer to stop sending further data. |
| 35 QUIC_DVLOG(1) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id(); |
| 36 Reset(QUIC_STREAM_NO_ERROR); |
| 37 } |
| 38 QuicSpdyStream::StopReading(); |
| 39 } |
| 40 |
| 30 } // namespace net | 41 } // namespace net |
| OLD | NEW |