| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/address_list.h" | 5 #include "net/base/address_list.h" |
| 6 | 6 |
| 7 #ifdef OS_WIN | 7 #ifdef OS_WIN |
| 8 #include <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
| 9 #include <wspiapi.h> // Needed for Win2k compat. | 9 #include <wspiapi.h> // Needed for Win2k compat. |
| 10 #else | 10 #else |
| 11 #include <netdb.h> | 11 #include <netdb.h> |
| 12 #endif | 12 #endif |
| 13 #include <stdlib.h> | 13 #include <stdlib.h> |
| 14 | 14 |
| 15 #if defined(OS_FREEBSD) |
| 16 #include <netinet/in.h> |
| 17 #include <sys/socket.h> |
| 18 #endif |
| 19 |
| 15 #include "base/logging.h" | 20 #include "base/logging.h" |
| 16 | 21 |
| 17 namespace net { | 22 namespace net { |
| 18 | 23 |
| 19 namespace { | 24 namespace { |
| 20 | 25 |
| 21 // Make a deep copy of |info|. This copy should be deleted using | 26 // Make a deep copy of |info|. This copy should be deleted using |
| 22 // DeleteCopyOfAddrinfo(), and NOT freeaddrinfo(). | 27 // DeleteCopyOfAddrinfo(), and NOT freeaddrinfo(). |
| 23 struct addrinfo* CreateCopyOfAddrinfo(const struct addrinfo* info) { | 28 struct addrinfo* CreateCopyOfAddrinfo(const struct addrinfo* info) { |
| 24 struct addrinfo* copy = new struct addrinfo; | 29 struct addrinfo* copy = new struct addrinfo; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 AddressList::Data::~Data() { | 155 AddressList::Data::~Data() { |
| 151 // Call either freeaddrinfo(head), or FreeMyAddrinfo(head), depending who | 156 // Call either freeaddrinfo(head), or FreeMyAddrinfo(head), depending who |
| 152 // created the data. | 157 // created the data. |
| 153 if (is_system_created) | 158 if (is_system_created) |
| 154 freeaddrinfo(head); | 159 freeaddrinfo(head); |
| 155 else | 160 else |
| 156 FreeMyAddrinfo(head); | 161 FreeMyAddrinfo(head); |
| 157 } | 162 } |
| 158 | 163 |
| 159 } // namespace net | 164 } // namespace net |
| OLD | NEW |