| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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_session.h" | 5 #include "net/quic/core/quic_spdy_session.h" |
| 6 | 6 |
| 7 #include <algorithm> |
| 7 #include <cstdint> | 8 #include <cstdint> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <utility> | 10 #include <utility> |
| 10 | 11 |
| 11 #include "net/quic/core/quic_flags.h" | 12 #include "net/quic/core/quic_flags.h" |
| 12 #include "net/quic/core/quic_headers_stream.h" | 13 #include "net/quic/core/quic_headers_stream.h" |
| 13 #include "net/quic/platform/api/quic_bug_tracker.h" | 14 #include "net/quic/platform/api/quic_bug_tracker.h" |
| 14 #include "net/quic/platform/api/quic_logging.h" | 15 #include "net/quic/platform/api/quic_logging.h" |
| 15 #include "net/quic/platform/api/quic_str_cat.h" | 16 #include "net/quic/platform/api/quic_str_cat.h" |
| 16 | 17 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 145 |
| 145 void OnDataFrameHeader(SpdyStreamId stream_id, | 146 void OnDataFrameHeader(SpdyStreamId stream_id, |
| 146 size_t length, | 147 size_t length, |
| 147 bool fin) override { | 148 bool fin) override { |
| 148 if (session_->OnDataFrameHeader(stream_id, length, fin)) { | 149 if (session_->OnDataFrameHeader(stream_id, length, fin)) { |
| 149 return; | 150 return; |
| 150 } | 151 } |
| 151 CloseConnection("SPDY DATA frame received."); | 152 CloseConnection("SPDY DATA frame received."); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void OnRstStream(SpdyStreamId stream_id, | 155 void OnRstStream(SpdyStreamId stream_id, SpdyErrorCode error_code) override { |
| 155 SpdyRstStreamStatus status) override { | |
| 156 CloseConnection("SPDY RST_STREAM frame received."); | 156 CloseConnection("SPDY RST_STREAM frame received."); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void OnSetting(SpdySettingsIds id, uint32_t value) override { | 159 void OnSetting(SpdySettingsIds id, uint32_t value) override { |
| 160 if (!FLAGS_quic_reloadable_flag_quic_respect_http2_settings_frame) { | 160 if (!FLAGS_quic_reloadable_flag_quic_respect_http2_settings_frame) { |
| 161 CloseConnection("SPDY SETTINGS frame received."); | 161 CloseConnection("SPDY SETTINGS frame received."); |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 switch (id) { | 164 switch (id) { |
| 165 case SETTINGS_HEADER_TABLE_SIZE: | 165 case SETTINGS_HEADER_TABLE_SIZE: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (!FLAGS_quic_reloadable_flag_quic_respect_http2_settings_frame) { | 203 if (!FLAGS_quic_reloadable_flag_quic_respect_http2_settings_frame) { |
| 204 CloseConnection("SPDY SETTINGS frame received."); | 204 CloseConnection("SPDY SETTINGS frame received."); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 void OnPing(SpdyPingId unique_id, bool is_ack) override { | 208 void OnPing(SpdyPingId unique_id, bool is_ack) override { |
| 209 CloseConnection("SPDY PING frame received."); | 209 CloseConnection("SPDY PING frame received."); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void OnGoAway(SpdyStreamId last_accepted_stream_id, | 212 void OnGoAway(SpdyStreamId last_accepted_stream_id, |
| 213 SpdyGoAwayStatus status) override { | 213 SpdyErrorCode error_code) override { |
| 214 CloseConnection("SPDY GOAWAY frame received."); | 214 CloseConnection("SPDY GOAWAY frame received."); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void OnHeaders(SpdyStreamId stream_id, | 217 void OnHeaders(SpdyStreamId stream_id, |
| 218 bool has_priority, | 218 bool has_priority, |
| 219 int weight, | 219 int weight, |
| 220 SpdyStreamId /*parent_stream_id*/, | 220 SpdyStreamId /*parent_stream_id*/, |
| 221 bool /*exclusive*/, | 221 bool /*exclusive*/, |
| 222 bool fin, | 222 bool fin, |
| 223 bool end) override { | 223 bool end) override { |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 set_max_uncompressed_header_bytes); | 743 set_max_uncompressed_header_bytes); |
| 744 } | 744 } |
| 745 | 745 |
| 746 void QuicSpdySession::CloseConnectionWithDetails(QuicErrorCode error, | 746 void QuicSpdySession::CloseConnectionWithDetails(QuicErrorCode error, |
| 747 const string& details) { | 747 const string& details) { |
| 748 connection()->CloseConnection( | 748 connection()->CloseConnection( |
| 749 error, details, ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 749 error, details, ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace net | 752 } // namespace net |
| OLD | NEW |