Skip to content

Commit

Permalink
Merge branch 'PHP-5.4'
Browse files Browse the repository at this point in the history
Conflicts:
	ext/sockets/multicast.h
  • Loading branch information
lstrojny committed Sep 19, 2012
2 parents 2211300 + dd6b7ea commit 1c42360
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ext/sockets/multicast.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

/* $Id$ */

#if defined(MCAST_JOIN_GROUP)
#if defined(MCAST_JOIN_GROUP) && \
(!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \
!defined(__APPLE__)
#define RFC3678_API 1
/* has block/unblock and source membership, in this case for both IPv4 and IPv6 */
#define HAS_MCAST_EXT 1
#elif defined(IP_ADD_SOURCE_MEMBERSHIP)
#elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__)
/* has block/unblock and source membership, but only for IPv4 */
#define HAS_MCAST_EXT 1
#endif
Expand Down
22 changes: 22 additions & 0 deletions ext/sockets/tests/bug63000.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
Bug #63000: Multicast on OSX
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('skip sockets extension not available.');
}
if (PHP_OS !== 'Darwin') {
die('is not OSX.');
}
--FILE--
<?php
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '0.0.0.0', 31057);

$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array(
"group" => '224.0.0.251',
"interface" => 0,
));
var_dump($so);
--EXPECTF--
bool(true)

0 comments on commit 1c42360

Please sign in to comment.