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

Unified Diff: runtime/bin/socket_macos.cc

Issue 117723003: Fix most UDP issues on Mac OS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_macos.cc
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index b1a35f086fadfce913b4f71ccfe30e132b7e9e53..2ea3066b2ce090bb4f626e9a8b46f8af1e8b9116 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -601,10 +601,10 @@ static bool JoinOrLeaveMulticast(intptr_t fd,
struct ip_mreq mreq;
memmove(&mreq.imr_multiaddr,
&addr->in.sin_addr,
- SocketAddress::GetAddrLength(addr));
+ SocketAddress::GetInAddrLength(addr));
memmove(&mreq.imr_interface,
&interface->in.sin_addr,
- SocketAddress::GetAddrLength(interface));
+ SocketAddress::GetInAddrLength(interface));
if (join) {
return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq))) == 0;
@@ -617,7 +617,7 @@ static bool JoinOrLeaveMulticast(intptr_t fd,
struct ipv6_mreq mreq;
memmove(&mreq.ipv6mr_multiaddr,
&addr->in6.sin6_addr,
- SocketAddress::GetAddrLength(addr));
+ SocketAddress::GetInAddrLength(addr));
mreq.ipv6mr_interface = interfaceIndex;
if (join) {
return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
@@ -632,28 +632,6 @@ static bool JoinOrLeaveMulticast(intptr_t fd,
bool Socket::JoinMulticast(
intptr_t fd, RawAddr* addr, RawAddr* interface, int interfaceIndex) {
return JoinOrLeaveMulticast(fd, addr, interface, interfaceIndex, true);
Anders Johnsen 2013/12/18 11:29:49 Indentation here and line above.
Søren Gjesse 2013/12/18 11:56:29 Done.
- if (addr->addr.sa_family == AF_INET) {
- ASSERT(interface->addr.sa_family == AF_INET);
- struct ip_mreq mreq;
- memmove(&mreq.imr_multiaddr,
- &addr->in.sin_addr,
- SocketAddress::GetAddrLength(addr));
- memmove(&mreq.imr_interface,
- &interface->in.sin_addr,
- SocketAddress::GetAddrLength(interface));
- return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
- fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq))) == 0;
- } else {
- ASSERT(addr->addr.sa_family == AF_INET6);
- ASSERT(interface->addr.sa_family == AF_INET6);
- struct ipv6_mreq mreq;
- memmove(&mreq.ipv6mr_multiaddr,
- &addr->in6.sin6_addr,
- SocketAddress::GetAddrLength(addr));
- mreq.ipv6mr_interface = interfaceIndex;
- return TEMP_FAILURE_RETRY_BLOCK_SIGNALS(setsockopt(
- fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq))) == 0;
- }
}
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698