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 "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/quic_spdy_session.h" | 9 #include "net/quic/quic_spdy_session.h" |
10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 if (FinishedReadingHeaders()) { | 189 if (FinishedReadingHeaders()) { |
190 sequencer()->SetUnblocked(); | 190 sequencer()->SetUnblocked(); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) { | 194 void QuicSpdyStream::OnTrailingHeadersComplete(bool fin, size_t /*frame_len*/) { |
195 DCHECK(!trailers_decompressed_); | 195 DCHECK(!trailers_decompressed_); |
196 if (fin_received()) { | 196 if (fin_received()) { |
197 DLOG(ERROR) << "Received Trailers after FIN, on stream: " << id(); | 197 DLOG(ERROR) << "Received Trailers after FIN, on stream: " << id(); |
198 session()->CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA); | 198 session()->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, |
| 199 "Trailers after fin"); |
199 return; | 200 return; |
200 } | 201 } |
201 if (!fin) { | 202 if (!fin) { |
202 DLOG(ERROR) << "Trailers must have FIN set, on stream: " << id(); | 203 DLOG(ERROR) << "Trailers must have FIN set, on stream: " << id(); |
203 session()->CloseConnection(QUIC_INVALID_HEADERS_STREAM_DATA); | 204 session()->CloseConnectionWithDetails(QUIC_INVALID_HEADERS_STREAM_DATA, |
| 205 "Fin missing from trailers"); |
204 return; | 206 return; |
205 } | 207 } |
206 trailers_decompressed_ = true; | 208 trailers_decompressed_ = true; |
207 } | 209 } |
208 | 210 |
209 void QuicSpdyStream::OnStreamReset(const QuicRstStreamFrame& frame) { | 211 void QuicSpdyStream::OnStreamReset(const QuicRstStreamFrame& frame) { |
210 if (frame.error_code != QUIC_STREAM_NO_ERROR || | 212 if (frame.error_code != QUIC_STREAM_NO_ERROR || |
211 version() <= QUIC_VERSION_28) { | 213 version() <= QUIC_VERSION_28) { |
212 ReliableQuicStream::OnStreamReset(frame); | 214 ReliableQuicStream::OnStreamReset(frame); |
213 return; | 215 return; |
(...skipping 25 matching lines...) Expand all Loading... |
239 if (!FLAGS_quic_supports_trailers) { | 241 if (!FLAGS_quic_supports_trailers) { |
240 return true; | 242 return true; |
241 } | 243 } |
242 // If no further trailing headers are expected, and the decompressed trailers | 244 // If no further trailing headers are expected, and the decompressed trailers |
243 // (if any) have been consumed, then reading of trailers is finished. | 245 // (if any) have been consumed, then reading of trailers is finished. |
244 bool no_more_trailers = fin_received() || trailers_decompressed_; | 246 bool no_more_trailers = fin_received() || trailers_decompressed_; |
245 return no_more_trailers && decompressed_trailers_.empty(); | 247 return no_more_trailers && decompressed_trailers_.empty(); |
246 } | 248 } |
247 | 249 |
248 } // namespace net | 250 } // namespace net |
OLD | NEW |