]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into test
authorDmitry Stogov <dmitry@zend.com>
Mon, 11 Aug 2014 07:38:41 +0000 (11:38 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 11 Aug 2014 07:38:41 +0000 (11:38 +0400)
* 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

12 files changed:
1  2 
ext/fileinfo/libmagic/softmagic.c
ext/ftp/ftp.c
ext/mysqlnd/mysqlnd_ps.c
ext/mysqlnd/mysqlnd_structs.h
ext/openssl/xp_ssl.c
ext/standard/basic_functions.c
ext/standard/info.c
ext/standard/math.c
ext/standard/php_math.h
ext/zlib/zlib_filter.c
main/network.c
main/streams/xp_socket.c

index 9432d55f219c899bfbe2a73553382318cf1cd09b,e000dff92e638c7affd5282c94a0f7b53c0758c3..ef0cbb3891c8240778abd938091f2cc1cadc9e2f
@@@ -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 ext/ftp/ftp.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc main/network.c
Simple merge
index 34ffec883acd0d968e33704e3c1eebd00a35e1e0,b4eda4b4723742b15eb89fa089e8c63ec9f74840..eb0e1cd29835c4b3746c927f4935e1525ad2332f
@@@ -582,6 -570,8 +582,8 @@@ static inline int php_tcp_sockop_bind(p
  {
        char *host = NULL;
        int portno, err;
 -      zval **tmpzval = NULL;
+       long sockopts = STREAM_SOCKOP_NONE;
++      zval *tmpzval = NULL;
  
  #ifdef AF_UNIX
        if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) {
                return -1;
        }
  
 -      if (stream->context
 -              && php_stream_context_get_option(stream->context, "socket", "so_reuseport", &tmpzval) == SUCCESS
 -              && zend_is_true(*tmpzval TSRMLS_CC)
+ #ifdef SO_REUSEPORT
 -      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 (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 (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) {
                        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);
        }
  
 -      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)
+ #ifdef SO_BROADCAST
++      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. */