From: Dmitry Stogov Date: Mon, 11 Aug 2014 07:38:41 +0000 (+0400) Subject: Merge branch 'master' into test X-Git-Tag: POST_PHPNG_MERGE~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c716e8b516146f0a10b0b89078ccd096a8b4b7b;p=php Merge branch 'master' into test * master: (39 commits) Add __debugInfo() to UPGRADING. fix TS build Update NEWS Update NEWS Update NEWS Small tidy ups and raise visibility of GitHub PR process Bug #41631: Observe socket read timeouts in SSL streams wrap int8_t and int16_t with #ifdef to avoid possible clashes - Updated to version 2014.6 (2014f) Removed Countable::count() change info from UPGRADE.INTERNALS too NEWS and UPGRADING for intdiv() Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option" Fixed skip case for intdiv 64-bit test Use callback structure Add EXPECTF Fix handling of multi-result sets with PS...used to clean not only the result set but the whole PS. 5.5.17 now 5.4.33-dev now Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option ... Conflicts: ext/fileinfo/libmagic/softmagic.c main/streams/xp_socket.c --- 4c716e8b516146f0a10b0b89078ccd096a8b4b7b diff --cc ext/fileinfo/libmagic/softmagic.c index 9432d55f21,e000dff92e..ef0cbb3891 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@@ -2088,11 -2097,13 +2095,13 @@@ magiccheck(struct magic_set *ms, struc return -1; } else { /* pce now contains the compiled regex */ - zval *retval; - zval *subpats; + zval retval; + zval subpats; char *haystack; - - MAKE_STD_ZVAL(retval); - ALLOC_INIT_ZVAL(subpats); ++ ZVAL_NULL(&retval); + ZVAL_NULL(&subpats); ++ /* Cut the search len from haystack, equals to REG_STARTEND */ haystack = estrndup(ms->search.s, ms->search.s_len); diff --cc main/streams/xp_socket.c index 34ffec883a,b4eda4b472..eb0e1cd298 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@@ -582,6 -570,8 +582,8 @@@ static inline int php_tcp_sockop_bind(p { char *host = NULL; int portno, err; + long sockopts = STREAM_SOCKOP_NONE; - zval **tmpzval = NULL; ++ zval *tmpzval = NULL; #ifdef AF_UNIX if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { @@@ -611,8 -601,28 +613,28 @@@ return -1; } + #ifdef SO_REUSEPORT - if (stream->context - && php_stream_context_get_option(stream->context, "socket", "so_reuseport", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval TSRMLS_CC) ++ if (PHP_STREAM_CONTEXT(stream) ++ && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_reuseport")) != NULL ++ && zend_is_true(tmpzval TSRMLS_CC) + ) { + sockopts |= STREAM_SOCKOP_SO_REUSEPORT; + } + #endif + + #ifdef SO_BROADCAST - if (&php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ - && stream->context - && php_stream_context_get_option(stream->context, "socket", "so_broadcast", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval TSRMLS_CC) ++ if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ ++ && PHP_STREAM_CONTEXT(stream) ++ && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL ++ && zend_is_true(tmpzval TSRMLS_CC) + ) { + sockopts |= STREAM_SOCKOP_SO_BROADCAST; + } + #endif + sock->socket = php_network_bind_socket_to_local_addr(host, portno, stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, + sockopts, xparam->want_errortext ? &xparam->outputs.error_text : NULL, &err TSRMLS_CC); @@@ -631,7 -641,8 +653,8 @@@ static inline int php_tcp_sockop_connec int portno, bindport = 0; int err = 0; int ret; - zval **tmpzval = NULL; + zval *tmpzval = NULL; + long sockopts = STREAM_SOCKOP_NONE; #ifdef AF_UNIX if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { @@@ -674,9 -685,19 +697,19 @@@ efree(host); return -1; } - bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); + bindto = parse_ip_address_ex(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); } + #ifdef SO_BROADCAST - if (&php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ - && stream->context - && php_stream_context_get_option(stream->context, "socket", "so_broadcast", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval TSRMLS_CC) ++ if (stream->ops == &php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ ++ && PHP_STREAM_CONTEXT(stream) ++ && (tmpzval = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "so_broadcast")) != NULL ++ && zend_is_true(tmpzval TSRMLS_CC) + ) { + sockopts |= STREAM_SOCKOP_SO_BROADCAST; + } + #endif + /* Note: the test here for php_stream_udp_socket_ops is important, because we * want the default to be TCP sockets so that the openssl extension can * re-use this code. */