OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/core/quic_config.h" | 5 #include "net/quic/core/quic_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/quic/core/crypto/crypto_handshake_message.h" | 10 #include "net/quic/core/crypto/crypto_handshake_message.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 319 } |
320 } | 320 } |
321 return QUIC_NO_ERROR; | 321 return QUIC_NO_ERROR; |
322 } | 322 } |
323 | 323 |
324 QuicConfig::QuicConfig() | 324 QuicConfig::QuicConfig() |
325 : max_time_before_crypto_handshake_(QuicTime::Delta::Zero()), | 325 : max_time_before_crypto_handshake_(QuicTime::Delta::Zero()), |
326 max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()), | 326 max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()), |
327 max_undecryptable_packets_(0), | 327 max_undecryptable_packets_(0), |
328 connection_options_(kCOPT, PRESENCE_OPTIONAL), | 328 connection_options_(kCOPT, PRESENCE_OPTIONAL), |
| 329 client_connection_options_(kCLOP, PRESENCE_OPTIONAL), |
329 idle_network_timeout_seconds_(kICSL, PRESENCE_REQUIRED), | 330 idle_network_timeout_seconds_(kICSL, PRESENCE_REQUIRED), |
330 silent_close_(kSCLS, PRESENCE_OPTIONAL), | 331 silent_close_(kSCLS, PRESENCE_OPTIONAL), |
331 max_streams_per_connection_(kMSPC, PRESENCE_OPTIONAL), | 332 max_streams_per_connection_(kMSPC, PRESENCE_OPTIONAL), |
332 max_incoming_dynamic_streams_(kMIDS, PRESENCE_OPTIONAL), | 333 max_incoming_dynamic_streams_(kMIDS, PRESENCE_OPTIONAL), |
333 bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL), | 334 bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL), |
334 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), | 335 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL), |
335 initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL), | 336 initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL), |
336 initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL), | 337 initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL), |
337 socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL), | 338 socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL), |
338 multipath_enabled_(kMPTH, PRESENCE_OPTIONAL), | 339 multipath_enabled_(kMPTH, PRESENCE_OPTIONAL), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 ContainsQuicTag(ReceivedConnectionOptions(), tag)) { | 386 ContainsQuicTag(ReceivedConnectionOptions(), tag)) { |
386 return true; | 387 return true; |
387 } | 388 } |
388 } else if (HasSendConnectionOptions() && | 389 } else if (HasSendConnectionOptions() && |
389 ContainsQuicTag(SendConnectionOptions(), tag)) { | 390 ContainsQuicTag(SendConnectionOptions(), tag)) { |
390 return true; | 391 return true; |
391 } | 392 } |
392 return false; | 393 return false; |
393 } | 394 } |
394 | 395 |
| 396 void QuicConfig::SetClientConnectionOptions( |
| 397 const QuicTagVector& client_connection_options) { |
| 398 client_connection_options_.SetSendValues(client_connection_options); |
| 399 } |
| 400 |
| 401 bool QuicConfig::HasClientRequestedIndependentOption( |
| 402 QuicTag tag, |
| 403 Perspective perspective) const { |
| 404 if (perspective == Perspective::IS_SERVER) { |
| 405 return (HasReceivedConnectionOptions() && |
| 406 ContainsQuicTag(ReceivedConnectionOptions(), tag)); |
| 407 } |
| 408 |
| 409 return (client_connection_options_.HasSendValues() && |
| 410 ContainsQuicTag(client_connection_options_.GetSendValues(), tag)); |
| 411 } |
| 412 |
395 void QuicConfig::SetIdleNetworkTimeout( | 413 void QuicConfig::SetIdleNetworkTimeout( |
396 QuicTime::Delta max_idle_network_timeout, | 414 QuicTime::Delta max_idle_network_timeout, |
397 QuicTime::Delta default_idle_network_timeout) { | 415 QuicTime::Delta default_idle_network_timeout) { |
398 idle_network_timeout_seconds_.set( | 416 idle_network_timeout_seconds_.set( |
399 static_cast<uint32_t>(max_idle_network_timeout.ToSeconds()), | 417 static_cast<uint32_t>(max_idle_network_timeout.ToSeconds()), |
400 static_cast<uint32_t>(default_idle_network_timeout.ToSeconds())); | 418 static_cast<uint32_t>(default_idle_network_timeout.ToSeconds())); |
401 } | 419 } |
402 | 420 |
403 QuicTime::Delta QuicConfig::IdleNetworkTimeout() const { | 421 QuicTime::Delta QuicConfig::IdleNetworkTimeout() const { |
404 return QuicTime::Delta::FromSeconds( | 422 return QuicTime::Delta::FromSeconds( |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 error_details); | 691 error_details); |
674 } | 692 } |
675 if (error == QUIC_NO_ERROR) { | 693 if (error == QUIC_NO_ERROR) { |
676 error = force_hol_blocking_.ProcessPeerHello(peer_hello, hello_type, | 694 error = force_hol_blocking_.ProcessPeerHello(peer_hello, hello_type, |
677 error_details); | 695 error_details); |
678 } | 696 } |
679 return error; | 697 return error; |
680 } | 698 } |
681 | 699 |
682 } // namespace net | 700 } // namespace net |
OLD | NEW |