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/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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void QuicSpdyStream::OnStreamHeadersComplete(bool fin, size_t frame_len) { | 106 void QuicSpdyStream::OnStreamHeadersComplete(bool fin, size_t frame_len) { |
107 headers_decompressed_ = true; | 107 headers_decompressed_ = true; |
108 if (fin) { | 108 if (fin) { |
109 OnStreamFrame(QuicStreamFrame(id(), fin, 0, StringPiece())); | 109 OnStreamFrame(QuicStreamFrame(id(), fin, 0, StringPiece())); |
110 } | 110 } |
111 if (FinishedReadingHeaders()) { | 111 if (FinishedReadingHeaders()) { |
112 sequencer()->SetUnblocked(); | 112 sequencer()->SetUnblocked(); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
| 116 void QuicSpdyStream::OnStreamReset(const QuicRstStreamFrame& frame) { |
| 117 if (frame.error_code != QUIC_STREAM_NO_ERROR || |
| 118 version() <= QUIC_VERSION_28) { |
| 119 ReliableQuicStream::OnStreamReset(frame); |
| 120 return; |
| 121 } |
| 122 DVLOG(1) << "Received QUIC_STREAM_NO_ERROR, not discarding response"; |
| 123 set_rst_received(true); |
| 124 MaybeIncreaseHighestReceivedOffset(frame.byte_offset); |
| 125 set_stream_error(frame.error_code); |
| 126 CloseWriteSide(); |
| 127 } |
| 128 |
116 void QuicSpdyStream::OnClose() { | 129 void QuicSpdyStream::OnClose() { |
117 ReliableQuicStream::OnClose(); | 130 ReliableQuicStream::OnClose(); |
118 | 131 |
119 if (visitor_) { | 132 if (visitor_) { |
120 Visitor* visitor = visitor_; | 133 Visitor* visitor = visitor_; |
121 // Calling Visitor::OnClose() may result the destruction of the visitor, | 134 // Calling Visitor::OnClose() may result the destruction of the visitor, |
122 // so we need to ensure we don't call it again. | 135 // so we need to ensure we don't call it again. |
123 visitor_ = nullptr; | 136 visitor_ = nullptr; |
124 visitor->OnClose(this); | 137 visitor->OnClose(this); |
125 } | 138 } |
126 } | 139 } |
127 | 140 |
128 bool QuicSpdyStream::FinishedReadingHeaders() const { | 141 bool QuicSpdyStream::FinishedReadingHeaders() const { |
129 return headers_decompressed_ && decompressed_headers_.empty(); | 142 return headers_decompressed_ && decompressed_headers_.empty(); |
130 } | 143 } |
131 | 144 |
132 } // namespace net | 145 } // namespace net |
OLD | NEW |