| 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/crypto/crypto_handshake_message.h" | 5 #include "net/quic/crypto/crypto_handshake_message.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
| 10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 QuicTagValueMap::const_iterator it = tag_value_map_.find(tag); | 102 QuicTagValueMap::const_iterator it = tag_value_map_.find(tag); |
| 103 QuicErrorCode ret = QUIC_NO_ERROR; | 103 QuicErrorCode ret = QUIC_NO_ERROR; |
| 104 | 104 |
| 105 if (it == tag_value_map_.end()) { | 105 if (it == tag_value_map_.end()) { |
| 106 ret = QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND; | 106 ret = QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND; |
| 107 } else if (it->second.size() % sizeof(QuicTag) != 0) { | 107 } else if (it->second.size() % sizeof(QuicTag) != 0) { |
| 108 ret = QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; | 108 ret = QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; |
| 109 } | 109 } |
| 110 | 110 |
| 111 if (ret != QUIC_NO_ERROR) { | 111 if (ret != QUIC_NO_ERROR) { |
| 112 *out_tags = NULL; | 112 *out_tags = nullptr; |
| 113 *out_len = 0; | 113 *out_len = 0; |
| 114 return ret; | 114 return ret; |
| 115 } | 115 } |
| 116 | 116 |
| 117 *out_tags = reinterpret_cast<const QuicTag*>(it->second.data()); | 117 *out_tags = reinterpret_cast<const QuicTag*>(it->second.data()); |
| 118 *out_len = it->second.size() / sizeof(QuicTag); | 118 *out_len = it->second.size() / sizeof(QuicTag); |
| 119 return ret; | 119 return ret; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool CryptoHandshakeMessage::GetStringPiece(QuicTag tag, | 122 bool CryptoHandshakeMessage::GetStringPiece(QuicTag tag, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); | 314 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); |
| 315 } | 315 } |
| 316 ret += "\n"; | 316 ret += "\n"; |
| 317 } | 317 } |
| 318 --indent; | 318 --indent; |
| 319 ret += string(2 * indent, ' ') + ">"; | 319 ret += string(2 * indent, ' ') + ">"; |
| 320 return ret; | 320 return ret; |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace net | 323 } // namespace net |
| OLD | NEW |