com php-src: Merge branch 'master' into test: ext/fileinfo/libmagic/softmagic.c ext/ftp/ftp.c ext/mysqlnd/mys qlnd_ps.c ext/mysqlnd/mysqlnd_structs.h
ext/openssl /xp_ssl.c ext/standard/basic_functions.c ext/standa rd/info.c ext/standard/math.c ext/standard/php_math .h ext/zlib/zlib_filter.c
main/network.c main/str eams/xp_socket.c
| From: | Dmitry Stogov | Date: | Mon, 11 Aug 2014 07:38:41 +0000 |
| Subject: | com php-src: Merge branch 'master' into test: ext/fileinfo/libmagic/softmagic.c ext/ftp/ftp.c ext/mysqlnd/mys qlnd_ps.c ext/mysqlnd/mysqlnd_structs.h ext/openssl /xp_ssl.c ext/standard/basic_functions.c ext/standa rd/info.c ext/standard/math.c ext/standard/php_math .h ext/zlib/zlib_filter.c main/network.c main/str eams/xp_socket.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79798@lists.php.net to get a copy of this message | ||
Commit: 4c716e8b516146f0a10b0b89078ccd096a8b4b7b
Author: Dmitry Stogov <dmitry@zend.com> Mon, 11 Aug 2014 11:38:41 +0400
Parents: 0ae305e62dad7542f7917823dac967488bcaffe2 97bb078bddef9ad0921d886c75ce6a77206145e3
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c716e8b516146f0a10b0b89078ccd096a8b4b7b
Log:
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
Bugs:
https://bugs.php.net/41631
Changed paths:
MM ext/fileinfo/libmagic/softmagic.c
MM ext/ftp/ftp.c
MM ext/mysqlnd/mysqlnd_ps.c
MM ext/mysqlnd/mysqlnd_structs.h
MM ext/openssl/xp_ssl.c
MM ext/standard/basic_functions.c
MM ext/standard/info.c
MM ext/standard/math.c
MM ext/standard/php_math.h
MM ext/zlib/zlib_filter.c
MM main/network.c
MM main/streams/xp_socket.c
Diff:
diff --cc ext/fileinfo/libmagic/softmagic.c
index 9432d55,e000dff..ef0cbb3
--- 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 34ffec8,b4eda4b..eb0e1cd
--- 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. */