Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: net/base/host_resolver_proc.cc

Issue 574001: Revert 38078 - Turn off ipv6 when there is no support at startup.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/host_resolver_proc.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/host_resolver_proc.h" 5 #include "net/base/host_resolver_proc.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #if defined(OS_POSIX) && !defined(OS_MACOSX) 9 #if defined(OS_POSIX) && !defined(OS_MACOSX)
10 #include <resolv.h> 10 #include <resolv.h>
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 #endif 221 #endif
222 222
223 if (err) 223 if (err)
224 return ERR_NAME_NOT_RESOLVED; 224 return ERR_NAME_NOT_RESOLVED;
225 225
226 addrlist->Adopt(ai); 226 addrlist->Adopt(ai);
227 return OK; 227 return OK;
228 } 228 }
229 229
230 // TODO(jar): The following is a simple estimate of ipv6 support. We may need
231 // to do a test resolution, and a test connection, to REALLY verify support.
232 // static
233 bool HostResolverProc::IPv6Supported() {
234 #if defined(OS_POSIX)
235 int test_socket;
236 #else
237 SOCKET test_socket;
238 #endif
239
240 test_socket = socket(AF_INET6, SOCK_STREAM, 0);
241 if (test_socket == -1)
242 return false;
243
244 #if defined(OS_POSIX)
245 close(test_socket);
246 #else
247 closesocket(test_socket);
248 #endif
249
250 return true;
251 }
252
253 } // namespace net 230 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_resolver_proc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698