| 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 #include "net/quic/core/quic_utils.h" | 5 #include "net/quic/core/quic_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 RETURN_STRING_LITERAL(NO_CHANGE); | 168 RETURN_STRING_LITERAL(NO_CHANGE); |
| 169 RETURN_STRING_LITERAL(PORT_CHANGE); | 169 RETURN_STRING_LITERAL(PORT_CHANGE); |
| 170 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); | 170 RETURN_STRING_LITERAL(IPV4_SUBNET_CHANGE); |
| 171 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); | 171 RETURN_STRING_LITERAL(IPV4_TO_IPV6_CHANGE); |
| 172 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); | 172 RETURN_STRING_LITERAL(IPV6_TO_IPV4_CHANGE); |
| 173 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); | 173 RETURN_STRING_LITERAL(IPV6_TO_IPV6_CHANGE); |
| 174 RETURN_STRING_LITERAL(IPV4_TO_IPV4_CHANGE); | 174 RETURN_STRING_LITERAL(IPV4_TO_IPV4_CHANGE); |
| 175 } | 175 } |
| 176 return "INVALID_PEER_ADDRESS_CHANGE_TYPE"; | 176 return "INVALID_PEER_ADDRESS_CHANGE_TYPE"; |
| 177 } | 177 } |
| 178 #undef RETURN_STRING_LITERAL |
| 178 | 179 |
| 179 // static | 180 // static |
| 180 PeerAddressChangeType QuicUtils::DetermineAddressChangeType( | 181 PeerAddressChangeType QuicUtils::DetermineAddressChangeType( |
| 181 const QuicSocketAddress& old_address, | 182 const QuicSocketAddress& old_address, |
| 182 const QuicSocketAddress& new_address) { | 183 const QuicSocketAddress& new_address) { |
| 183 if (!old_address.IsInitialized() || !new_address.IsInitialized() || | 184 if (!old_address.IsInitialized() || !new_address.IsInitialized() || |
| 184 old_address == new_address) { | 185 old_address == new_address) { |
| 185 return NO_CHANGE; | 186 return NO_CHANGE; |
| 186 } | 187 } |
| 187 | 188 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 if (length == 0 || ++iovnum >= iov.iov_count) { | 257 if (length == 0 || ++iovnum >= iov.iov_count) { |
| 257 break; | 258 break; |
| 258 } | 259 } |
| 259 src = static_cast<char*>(iov.iov[iovnum].iov_base); | 260 src = static_cast<char*>(iov.iov[iovnum].iov_base); |
| 260 copy_len = std::min(length, iov.iov[iovnum].iov_len); | 261 copy_len = std::min(length, iov.iov[iovnum].iov_len); |
| 261 } | 262 } |
| 262 QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; | 263 QUIC_BUG_IF(length > 0) << "Failed to copy entire length to buffer."; |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace net | 266 } // namespace net |
| OLD | NEW |