OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A server side dispatcher which dispatches a given client's data to their | 5 // A server side dispatcher which dispatches a given client's data to their |
6 // stream. | 6 // stream. |
7 | 7 |
8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 9 #define NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
10 | 10 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 virtual QuicPacketFate ValidityChecks(const QuicPacketHeader& header); | 173 virtual QuicPacketFate ValidityChecks(const QuicPacketHeader& header); |
174 | 174 |
175 // Create and return the time wait list manager for this dispatcher, which | 175 // Create and return the time wait list manager for this dispatcher, which |
176 // will be owned by the dispatcher as time_wait_list_manager_ | 176 // will be owned by the dispatcher as time_wait_list_manager_ |
177 virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager(); | 177 virtual QuicTimeWaitListManager* CreateQuicTimeWaitListManager(); |
178 | 178 |
179 QuicTimeWaitListManager* time_wait_list_manager() { | 179 QuicTimeWaitListManager* time_wait_list_manager() { |
180 return time_wait_list_manager_.get(); | 180 return time_wait_list_manager_.get(); |
181 } | 181 } |
182 | 182 |
183 const QuicVersionVector& supported_versions() const { | 183 const QuicVersionVector& GetSupportedVersions(); |
184 return supported_versions_; | |
185 } | |
186 | 184 |
187 const IPEndPoint& current_server_address() { return current_server_address_; } | 185 const IPEndPoint& current_server_address() { return current_server_address_; } |
188 const IPEndPoint& current_client_address() { return current_client_address_; } | 186 const IPEndPoint& current_client_address() { return current_client_address_; } |
189 const QuicReceivedPacket& current_packet() { return *current_packet_; } | 187 const QuicReceivedPacket& current_packet() { return *current_packet_; } |
190 | 188 |
191 const QuicConfig& config() const { return config_; } | 189 const QuicConfig& config() const { return config_; } |
192 | 190 |
193 const QuicCryptoServerConfig* crypto_config() const { return crypto_config_; } | 191 const QuicCryptoServerConfig* crypto_config() const { return crypto_config_; } |
194 | 192 |
195 QuicCompressedCertsCache* compressed_certs_cache() { | 193 QuicCompressedCertsCache* compressed_certs_cache() { |
(...skipping 19 matching lines...) Expand all Loading... |
215 // cleaned up for bug 16950226.) | 213 // cleaned up for bug 16950226.) |
216 virtual QuicPacketWriter* CreatePerConnectionWriter(); | 214 virtual QuicPacketWriter* CreatePerConnectionWriter(); |
217 | 215 |
218 // Returns true if a session should be created for a connection with an | 216 // Returns true if a session should be created for a connection with an |
219 // unknown version identified by |version_tag|. | 217 // unknown version identified by |version_tag|. |
220 virtual bool ShouldCreateSessionForUnknownVersion(QuicTag version_tag); | 218 virtual bool ShouldCreateSessionForUnknownVersion(QuicTag version_tag); |
221 | 219 |
222 void SetLastError(QuicErrorCode error); | 220 void SetLastError(QuicErrorCode error); |
223 | 221 |
224 // Called when the public header has been parsed and the session has been | 222 // Called when the public header has been parsed and the session has been |
225 // looked up, and the session was not found in the active std::list of | 223 // looked up, and the session was not found in the active list of sessions. |
226 // sessions. | |
227 // Returns false if processing should stop after this call. | 224 // Returns false if processing should stop after this call. |
228 virtual bool OnUnauthenticatedUnknownPublicHeader( | 225 virtual bool OnUnauthenticatedUnknownPublicHeader( |
229 const QuicPacketPublicHeader& header); | 226 const QuicPacketPublicHeader& header); |
230 | 227 |
231 private: | 228 private: |
232 friend class net::test::QuicDispatcherPeer; | 229 friend class net::test::QuicDispatcherPeer; |
233 | 230 |
234 // Removes the session from the session map and write blocked list, and adds | 231 // Removes the session from the session map and write blocked list, and adds |
235 // the ConnectionId to the time-wait list. If |session_closed_statelessly| is | 232 // the ConnectionId to the time-wait list. If |session_closed_statelessly| is |
236 // true, any future packets for the ConnectionId will be black-holed. | 233 // true, any future packets for the ConnectionId will be black-holed. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // An alarm which deletes closed sessions. | 272 // An alarm which deletes closed sessions. |
276 std::unique_ptr<QuicAlarm> delete_sessions_alarm_; | 273 std::unique_ptr<QuicAlarm> delete_sessions_alarm_; |
277 | 274 |
278 // The writer to write to the socket with. | 275 // The writer to write to the socket with. |
279 std::unique_ptr<QuicPacketWriter> writer_; | 276 std::unique_ptr<QuicPacketWriter> writer_; |
280 | 277 |
281 // This vector contains QUIC versions which we currently support. | 278 // This vector contains QUIC versions which we currently support. |
282 // This should be ordered such that the highest supported version is the first | 279 // This should be ordered such that the highest supported version is the first |
283 // element, with subsequent elements in descending order (versions can be | 280 // element, with subsequent elements in descending order (versions can be |
284 // skipped as necessary). | 281 // skipped as necessary). |
285 const QuicVersionVector supported_versions_; | 282 QuicVersionVector supported_versions_; |
| 283 |
| 284 // FLAGS_quic_disable_pre_30 |
| 285 bool disable_quic_pre_30_; |
| 286 // The list of versions that may be supported by this dispatcher. |
| 287 // |supported_versions| is derived from this list and |disable_quic_pre_30_|. |
| 288 const QuicVersionVector allowed_supported_versions_; |
286 | 289 |
287 // Information about the packet currently being handled. | 290 // Information about the packet currently being handled. |
288 IPEndPoint current_client_address_; | 291 IPEndPoint current_client_address_; |
289 IPEndPoint current_server_address_; | 292 IPEndPoint current_server_address_; |
290 const QuicReceivedPacket* current_packet_; | 293 const QuicReceivedPacket* current_packet_; |
291 QuicConnectionId current_connection_id_; | 294 QuicConnectionId current_connection_id_; |
292 | 295 |
293 QuicFramer framer_; | 296 QuicFramer framer_; |
294 | 297 |
295 // The last error set by SetLastError(), which is called by | 298 // The last error set by SetLastError(), which is called by |
296 // framer_visitor_->OnError(). | 299 // framer_visitor_->OnError(). |
297 QuicErrorCode last_error_; | 300 QuicErrorCode last_error_; |
298 | 301 |
299 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); | 302 DISALLOW_COPY_AND_ASSIGN(QuicDispatcher); |
300 }; | 303 }; |
301 | 304 |
302 } // namespace net | 305 } // namespace net |
303 | 306 |
304 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ | 307 #endif // NET_TOOLS_QUIC_QUIC_DISPATCHER_H_ |
OLD | NEW |