diff options
author | Christopher Jones <sixd@php.net> | 2012-09-19 17:09:30 -0700 |
---|---|---|
committer | Christopher Jones <sixd@php.net> | 2012-09-19 17:09:30 -0700 |
commit | 6ce88bbc71e81c4f367dcb7da7a9e2bf8dbd3df0 (patch) | |
tree | d5d42ff4452ce4c8ca3ff42757094eb972cf0fc8 | |
parent | 2a352f6af790c820578e7f543907cab304de82fa (diff) | |
parent | 1c423601a8d436c914b9d76ef153b2b5517bc5c8 (diff) | |
download | php-git-6ce88bbc71e81c4f367dcb7da7a9e2bf8dbd3df0.tar.gz |
Merge branch 'master' of https://git.php.net/repository/php-src
* 'master' of https://git.php.net/repository/php-src:
Bug #63000: MCAST_JOIN_GROUP on OSX is broken
Fixed bug #61442 (exception threw in __autoload can not be catched)
-rw-r--r-- | ext/sockets/multicast.h | 6 | ||||
-rw-r--r-- | ext/sockets/tests/bug63000.phpt | 22 |
2 files changed, 26 insertions, 2 deletions
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index 1b8c3c9e0a..5619c9c7fb 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -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 diff --git a/ext/sockets/tests/bug63000.phpt b/ext/sockets/tests/bug63000.phpt new file mode 100644 index 0000000000..c806ba4c08 --- /dev/null +++ b/ext/sockets/tests/bug63000.phpt @@ -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) |