OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 if (match >= 4) { | 215 if (match >= 4) { |
216 uint32_t ip = ((a & 0xFF) << 24) | ((b & 0xFF) << 16) | ((c & 0xFF) << 8) | | 216 uint32_t ip = ((a & 0xFF) << 24) | ((b & 0xFF) << 16) | ((c & 0xFF) << 8) | |
217 (d & 0xFF); | 217 (d & 0xFF); |
218 if ((match < 5) || (m > 32)) | 218 if ((match < 5) || (m > 32)) |
219 m = 32; | 219 m = 32; |
220 else if (m < 0) | 220 else if (m < 0) |
221 m = 0; | 221 m = 0; |
222 uint32_t mask = (m == 0) ? 0 : (~0UL) << (32 - m); | 222 uint32_t mask = (m == 0) ? 0 : (~0UL) << (32 - m); |
223 SocketAddress addr(url.host(), 0); | 223 SocketAddress addr(url.host(), 0); |
224 // TODO: Support IPv6 proxyitems. This code block is IPv4 only anyway. | 224 // TODO: Support IPv6 proxyitems. This code block is IPv4 only anyway. |
225 return !addr.IsUnresolved() && | 225 return !addr.IsUnresolvedIP() && |
226 ((addr.ipaddr().v4AddressAsHostOrderInteger() & mask) == (ip & mask)); | 226 ((addr.ipaddr().v4AddressAsHostOrderInteger() & mask) == (ip & mask)); |
227 } | 227 } |
228 | 228 |
229 // .foo.com | 229 // .foo.com |
230 if (*item == '.') { | 230 if (*item == '.') { |
231 size_t hostlen = url.host().length(); | 231 size_t hostlen = url.host().length(); |
232 return (hostlen > len) | 232 return (hostlen > len) |
233 && (stricmp(url.host().c_str() + (hostlen - len), item) == 0); | 233 && (stricmp(url.host().c_str() + (hostlen - len), item) == 0); |
234 } | 234 } |
235 | 235 |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 if (!result) { | 1294 if (!result) { |
1295 // Either auto detection is not supported or we simply didn't | 1295 // Either auto detection is not supported or we simply didn't |
1296 // find any proxy, reset type. | 1296 // find any proxy, reset type. |
1297 proxy->type = rtc::PROXY_NONE; | 1297 proxy->type = rtc::PROXY_NONE; |
1298 } | 1298 } |
1299 } | 1299 } |
1300 return result; | 1300 return result; |
1301 } | 1301 } |
1302 | 1302 |
1303 } // namespace rtc | 1303 } // namespace rtc |
OLD | NEW |