| 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_headers_stream.h" | 5 #include "net/quic/quic_headers_stream.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" |
| 7 #include "net/quic/quic_session.h" | 8 #include "net/quic/quic_session.h" |
| 8 | 9 |
| 9 using base::StringPiece; | 10 using base::StringPiece; |
| 10 using std::string; | 11 using std::string; |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 const QuicStreamId kInvalidStreamId = 0; | 17 const QuicStreamId kInvalidStreamId = 0; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (fin && len == 0) { | 75 if (fin && len == 0) { |
| 75 // The framer invokes OnStreamFrameData with zero-length data and | 76 // The framer invokes OnStreamFrameData with zero-length data and |
| 76 // fin = true after processing a SYN_STREAM or SYN_REPLY frame | 77 // fin = true after processing a SYN_STREAM or SYN_REPLY frame |
| 77 // that had the fin bit set. | 78 // that had the fin bit set. |
| 78 return; | 79 return; |
| 79 } | 80 } |
| 80 CloseConnection("SPDY DATA frame received."); | 81 CloseConnection("SPDY DATA frame received."); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void OnError(SpdyFramer* framer) override { | 84 void OnError(SpdyFramer* framer) override { |
| 84 CloseConnection("SPDY framing error."); | 85 CloseConnection(base::StringPrintf( |
| 86 "SPDY framing error: %s", |
| 87 SpdyFramer::ErrorCodeToString(framer->error_code()))); |
| 85 } | 88 } |
| 86 | 89 |
| 87 void OnDataFrameHeader(SpdyStreamId stream_id, | 90 void OnDataFrameHeader(SpdyStreamId stream_id, |
| 88 size_t length, | 91 size_t length, |
| 89 bool fin) override { | 92 bool fin) override { |
| 90 CloseConnection("SPDY DATA frame received."); | 93 CloseConnection("SPDY DATA frame received."); |
| 91 } | 94 } |
| 92 | 95 |
| 93 void OnRstStream(SpdyStreamId stream_id, | 96 void OnRstStream(SpdyStreamId stream_id, |
| 94 SpdyRstStreamStatus status) override { | 97 SpdyRstStreamStatus status) override { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 DCHECK_EQ(kInvalidStreamId, stream_id_); | 273 DCHECK_EQ(kInvalidStreamId, stream_id_); |
| 271 DCHECK_EQ(0u, frame_len_); | 274 DCHECK_EQ(0u, frame_len_); |
| 272 frame_len_ = frame_len; | 275 frame_len_ = frame_len; |
| 273 } | 276 } |
| 274 | 277 |
| 275 bool QuicHeadersStream::IsConnected() { | 278 bool QuicHeadersStream::IsConnected() { |
| 276 return session()->connection()->connected(); | 279 return session()->connection()->connected(); |
| 277 } | 280 } |
| 278 | 281 |
| 279 } // namespace net | 282 } // namespace net |
| OLD | NEW |