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

Side by Side Diff: runtime/bin/socket_android.cc

Issue 254383003: Small fixes for Android. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | « no previous file | runtime/platform/thread_android.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <stdio.h> // NOLINT 9 #include <stdio.h> // NOLINT
10 #include <stdlib.h> // NOLINT 10 #include <stdlib.h> // NOLINT
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 215
216 AddressList<SocketAddress>* Socket::LookupAddress(const char* host, 216 AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
217 int type, 217 int type,
218 OSError** os_error) { 218 OSError** os_error) {
219 // Perform a name lookup for a host name. 219 // Perform a name lookup for a host name.
220 struct addrinfo hints; 220 struct addrinfo hints;
221 memset(&hints, 0, sizeof(hints)); 221 memset(&hints, 0, sizeof(hints));
222 hints.ai_family = SocketAddress::FromType(type); 222 hints.ai_family = SocketAddress::FromType(type);
223 hints.ai_socktype = SOCK_STREAM; 223 hints.ai_socktype = SOCK_STREAM;
224 hints.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG); 224 hints.ai_flags = 0;
Anders Johnsen 2014/04/24 06:49:01 Please clean up the code below, as well. Why can w
225 hints.ai_protocol = IPPROTO_TCP; 225 hints.ai_protocol = IPPROTO_TCP;
226 struct addrinfo* info = NULL; 226 struct addrinfo* info = NULL;
227 int status = getaddrinfo(host, 0, &hints, &info); 227 int status = getaddrinfo(host, 0, &hints, &info);
228 if (status != 0) { 228 if (status != 0) {
229 // We failed, try without AI_ADDRCONFIG. This can happen when looking up 229 // We failed, try without AI_ADDRCONFIG. This can happen when looking up
230 // e.g. '::1', when there are no IPv6 addresses. 230 // e.g. '::1', when there are no IPv6 addresses.
231 hints.ai_flags = AI_V4MAPPED; 231 hints.ai_flags = AI_V4MAPPED;
232 status = getaddrinfo(host, 0, &hints, &info); 232 status = getaddrinfo(host, 0, &hints, &info);
233 if (status != 0) { 233 if (status != 0) {
234 ASSERT(*os_error == NULL); 234 ASSERT(*os_error == NULL);
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 mreq.gr_interface = interfaceIndex; 561 mreq.gr_interface = interfaceIndex;
562 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr)); 562 memmove(&mreq.gr_group, &addr->ss, SocketAddress::GetAddrLength(addr));
563 return NO_RETRY_EXPECTED(setsockopt( 563 return NO_RETRY_EXPECTED(setsockopt(
564 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0; 564 fd, proto, MCAST_LEAVE_GROUP, &mreq, sizeof(mreq))) == 0;
565 } 565 }
566 566
567 } // namespace bin 567 } // namespace bin
568 } // namespace dart 568 } // namespace dart
569 569
570 #endif // defined(TARGET_OS_ANDROID) 570 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « no previous file | runtime/platform/thread_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698