| OLD | NEW |
| 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/core/quic_spdy_stream.h" | 5 #include "net/quic/core/quic_spdy_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 sequencer()->SetBlockedUntilFlush(); | 40 sequencer()->SetBlockedUntilFlush(); |
| 41 spdy_session_->RegisterStreamPriority(id, priority_); | 41 spdy_session_->RegisterStreamPriority(id, priority_); |
| 42 } | 42 } |
| 43 | 43 |
| 44 QuicSpdyStream::~QuicSpdyStream() { | 44 QuicSpdyStream::~QuicSpdyStream() { |
| 45 if (spdy_session_ != nullptr) { | 45 if (spdy_session_ != nullptr) { |
| 46 spdy_session_->UnregisterStreamPriority(id()); | 46 spdy_session_->UnregisterStreamPriority(id()); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void QuicSpdyStream::CloseWriteSide() { | |
| 51 if (!fin_received() && !rst_received() && sequencer()->ignore_read_data() && | |
| 52 !rst_sent()) { | |
| 53 DCHECK(fin_sent()); | |
| 54 // Tell the peer to stop sending further data. | |
| 55 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | |
| 56 Reset(QUIC_STREAM_NO_ERROR); | |
| 57 } | |
| 58 | |
| 59 QuicStream::CloseWriteSide(); | |
| 60 } | |
| 61 | |
| 62 void QuicSpdyStream::StopReading() { | 50 void QuicSpdyStream::StopReading() { |
| 63 if (!fin_received() && !rst_received() && write_side_closed() && | 51 if (!fin_received() && !rst_received() && write_side_closed() && |
| 64 !rst_sent()) { | 52 !rst_sent()) { |
| 65 DCHECK(fin_sent()); | 53 DCHECK(fin_sent()); |
| 66 // Tell the peer to stop sending further data. | 54 // Tell the peer to stop sending further data. |
| 67 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); | 55 DVLOG(1) << ENDPOINT << "Send QUIC_STREAM_NO_ERROR on stream " << id(); |
| 68 Reset(QUIC_STREAM_NO_ERROR); | 56 Reset(QUIC_STREAM_NO_ERROR); |
| 69 } | 57 } |
| 70 QuicStream::StopReading(); | 58 QuicStream::StopReading(); |
| 71 } | 59 } |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 QuicAckListenerInterface* ack_notifier_delegate) { | 329 QuicAckListenerInterface* ack_notifier_delegate) { |
| 342 if (spdy_session_->headers_stream() != nullptr && | 330 if (spdy_session_->headers_stream() != nullptr && |
| 343 spdy_session_->force_hol_blocking()) { | 331 spdy_session_->force_hol_blocking()) { |
| 344 return spdy_session_->headers_stream()->WritevStreamData( | 332 return spdy_session_->headers_stream()->WritevStreamData( |
| 345 id(), iov, offset, fin, ack_notifier_delegate); | 333 id(), iov, offset, fin, ack_notifier_delegate); |
| 346 } | 334 } |
| 347 return QuicStream::WritevDataInner(iov, offset, fin, ack_notifier_delegate); | 335 return QuicStream::WritevDataInner(iov, offset, fin, ack_notifier_delegate); |
| 348 } | 336 } |
| 349 | 337 |
| 350 } // namespace net | 338 } // namespace net |
| OLD | NEW |