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/quic_config.h" | 5 #include "net/quic/quic_config.h" |
6 | 6 |
7 using std::string; | 7 using std::string; |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 void QuicConfig::SetDefaults() { | 24 void QuicConfig::SetDefaults() { |
25 idle_connection_state_lifetime_ = QuicTime::Delta::FromSeconds(300); | 25 idle_connection_state_lifetime_ = QuicTime::Delta::FromSeconds(300); |
26 keepalive_timeout_ = QuicTime::Delta::Zero(); | 26 keepalive_timeout_ = QuicTime::Delta::Zero(); |
27 congestion_control_.clear(); | 27 congestion_control_.clear(); |
28 congestion_control_.push_back(kQBIC); | 28 congestion_control_.push_back(kQBIC); |
29 } | 29 } |
30 | 30 |
31 bool QuicConfig::SetFromHandshakeMessage(const CryptoHandshakeMessage& scfg) { | 31 bool QuicConfig::SetFromHandshakeMessage(const CryptoHandshakeMessage& scfg) { |
32 const CryptoTag* cgst; | 32 const QuicTag* cgst; |
33 size_t num_cgst; | 33 size_t num_cgst; |
34 QuicErrorCode error; | 34 QuicErrorCode error; |
35 | 35 |
36 error = scfg.GetTaglist(kCGST, &cgst, &num_cgst); | 36 error = scfg.GetTaglist(kCGST, &cgst, &num_cgst); |
37 if (error != QUIC_NO_ERROR) { | 37 if (error != QUIC_NO_ERROR) { |
38 return false; | 38 return false; |
39 } | 39 } |
40 | 40 |
41 congestion_control_.assign(cgst, cgst + num_cgst); | 41 congestion_control_.assign(cgst, cgst + num_cgst); |
42 | 42 |
(...skipping 23 matching lines...) Expand all Loading... |
66 out->SetVector(kCGST, congestion_control_); | 66 out->SetVector(kCGST, congestion_control_); |
67 } | 67 } |
68 | 68 |
69 QuicErrorCode QuicConfig::ProcessFinalPeerHandshake( | 69 QuicErrorCode QuicConfig::ProcessFinalPeerHandshake( |
70 const CryptoHandshakeMessage& msg, | 70 const CryptoHandshakeMessage& msg, |
71 CryptoUtils::Priority priority, | 71 CryptoUtils::Priority priority, |
72 QuicNegotiatedParameters* out_params, | 72 QuicNegotiatedParameters* out_params, |
73 string* error_details) const { | 73 string* error_details) const { |
74 DCHECK(error_details != NULL); | 74 DCHECK(error_details != NULL); |
75 | 75 |
76 const CryptoTag* their_congestion_controls; | 76 const QuicTag* their_congestion_controls; |
77 size_t num_their_congestion_controls; | 77 size_t num_their_congestion_controls; |
78 QuicErrorCode error; | 78 QuicErrorCode error; |
79 | 79 |
80 error = msg.GetTaglist(kCGST, &their_congestion_controls, | 80 error = msg.GetTaglist(kCGST, &their_congestion_controls, |
81 &num_their_congestion_controls); | 81 &num_their_congestion_controls); |
82 if (error != QUIC_NO_ERROR) { | 82 if (error != QUIC_NO_ERROR) { |
83 *error_details = "Missing CGST"; | 83 *error_details = "Missing CGST"; |
84 return error; | 84 return error; |
85 } | 85 } |
86 | 86 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 default: | 120 default: |
121 *error_details = "Bad KATO"; | 121 *error_details = "Bad KATO"; |
122 return error; | 122 return error; |
123 } | 123 } |
124 | 124 |
125 return QUIC_NO_ERROR; | 125 return QUIC_NO_ERROR; |
126 } | 126 } |
127 | 127 |
128 } // namespace net | 128 } // namespace net |
129 | 129 |
OLD | NEW |