| 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" | |
| 10 #include "net/quic/core/crypto/crypto_handshake_message.h" | 9 #include "net/quic/core/crypto/crypto_handshake_message.h" |
| 11 #include "net/quic/core/crypto/crypto_protocol.h" | 10 #include "net/quic/core/crypto/crypto_protocol.h" |
| 12 #include "net/quic/core/quic_flags.h" | 11 #include "net/quic/core/quic_flags.h" |
| 13 #include "net/quic/core/quic_socket_address_coder.h" | 12 #include "net/quic/core/quic_socket_address_coder.h" |
| 14 #include "net/quic/core/quic_utils.h" | 13 #include "net/quic/core/quic_utils.h" |
| 15 #include "net/quic/platform/api/quic_bug_tracker.h" | 14 #include "net/quic/platform/api/quic_bug_tracker.h" |
| 15 #include "net/quic/platform/api/quic_logging.h" |
| 16 | 16 |
| 17 using std::string; | 17 using std::string; |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 // Reads the value corresponding to |name_| from |msg| into |out|. If the | 21 // Reads the value corresponding to |name_| from |msg| into |out|. If the |
| 22 // |name_| is absent in |msg| and |presence| is set to OPTIONAL |out| is set | 22 // |name_| is absent in |msg| and |presence| is set to OPTIONAL |out| is set |
| 23 // to |default_value|. | 23 // to |default_value|. |
| 24 QuicErrorCode ReadUint32(const CryptoHandshakeMessage& msg, | 24 QuicErrorCode ReadUint32(const CryptoHandshakeMessage& msg, |
| 25 QuicTag tag, | 25 QuicTag tag, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 QuicErrorCode error = | 235 QuicErrorCode error = |
| 236 peer_hello.GetTaglist(tag_, &received_tags, &received_tags_length); | 236 peer_hello.GetTaglist(tag_, &received_tags, &received_tags_length); |
| 237 switch (error) { | 237 switch (error) { |
| 238 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: | 238 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND: |
| 239 if (presence_ == PRESENCE_OPTIONAL) { | 239 if (presence_ == PRESENCE_OPTIONAL) { |
| 240 return QUIC_NO_ERROR; | 240 return QUIC_NO_ERROR; |
| 241 } | 241 } |
| 242 *error_details = "Missing " + QuicTagToString(tag_); | 242 *error_details = "Missing " + QuicTagToString(tag_); |
| 243 break; | 243 break; |
| 244 case QUIC_NO_ERROR: | 244 case QUIC_NO_ERROR: |
| 245 DVLOG(1) << "Received Connection Option tags from receiver."; | 245 QUIC_DVLOG(1) << "Received Connection Option tags from receiver."; |
| 246 has_receive_values_ = true; | 246 has_receive_values_ = true; |
| 247 for (size_t i = 0; i < received_tags_length; ++i) { | 247 for (size_t i = 0; i < received_tags_length; ++i) { |
| 248 receive_values_.push_back(received_tags[i]); | 248 receive_values_.push_back(received_tags[i]); |
| 249 } | 249 } |
| 250 break; | 250 break; |
| 251 default: | 251 default: |
| 252 *error_details = "Bad " + QuicTagToString(tag_); | 252 *error_details = "Bad " + QuicTagToString(tag_); |
| 253 break; | 253 break; |
| 254 } | 254 } |
| 255 return error; | 255 return error; |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 error_details); | 708 error_details); |
| 709 } | 709 } |
| 710 if (error == QUIC_NO_ERROR) { | 710 if (error == QUIC_NO_ERROR) { |
| 711 error = support_max_header_list_size_.ProcessPeerHello( | 711 error = support_max_header_list_size_.ProcessPeerHello( |
| 712 peer_hello, hello_type, error_details); | 712 peer_hello, hello_type, error_details); |
| 713 } | 713 } |
| 714 return error; | 714 return error; |
| 715 } | 715 } |
| 716 | 716 |
| 717 } // namespace net | 717 } // namespace net |
| OLD | NEW |