com php-src: further ext backports: ext/mysqlnd/mysqlnd_net .c ext/mysqlnd/mysqlnd_ps.c ext/opcache/ZendAccelerat or.c ext/opcache/ZendAccelerator.h
ext/opcache/zend_a ccelerator_module.c ext/opcache/zend_accelerator_modu le.h ext/openssl/xp_ssl.c
| From: | Anatol Belski | Date: | Sat, 15 Feb 2014 20:48:15 +0000 |
| Subject: | com php-src: further ext backports: ext/mysqlnd/mysqlnd_net .c ext/mysqlnd/mysqlnd_ps.c ext/opcache/ZendAccelerat or.c ext/opcache/ZendAccelerator.h ext/opcache/zend_a ccelerator_module.c ext/opcache/zend_accelerator_modu le.h ext/openssl/xp_ssl.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76076@lists.php.net to get a copy of this message | ||
Commit: 98f03086bbea21e0f4fff76001079b7b41527f6c
Author: Anatol Belski <ab@php.net> Sat, 15 Feb 2014 21:48:15 +0100
Parents: f2f78bc05336f4c706b9f104f7c6088c19f9bfa6
Branches: str_size_and_int64_56_backport
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=98f03086bbea21e0f4fff76001079b7b41527f6c
Log:
further ext backports
Changed paths:
M ext/mysqlnd/mysqlnd_net.c
M ext/mysqlnd/mysqlnd_ps.c
M ext/opcache/ZendAccelerator.c
M ext/opcache/ZendAccelerator.h
M ext/opcache/zend_accelerator_module.c
M ext/opcache/zend_accelerator_module.h
M ext/openssl/xp_ssl.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index c3b8f91..e85c2ed 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -900,11 +900,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0);
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
-#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, context TSRMLS_CC);
-#else
php_stream_context_set(net_stream, context);
-#endif
if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC)
< 0 ||
php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
{
@@ -920,11 +916,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
of the context, which means usage of already freed memory, bad. Actually we don't need this
context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove
it.
*/
-#if PHP_API_VERSION >= 20131106
- php_stream_context_set(net_stream, NULL TSRMLS_CC);
-#else
php_stream_context_set(net_stream, NULL);
-#endif
if (net->data->options.timeout_read) {
struct timeval tv;
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index ed0f478..42338f0 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -38,7 +38,6 @@ const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar **
request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar **
request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES *result, void *param,
php_uint_t flags,
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 869fc64..90f2e78 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2552,11 +2552,7 @@ static int accel_startup(zend_extension *extension)
_setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */
#endif
-#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
- if (start_accel_module(TSRMLS_C) == FAILURE) {
-#else
if (start_accel_module() == FAILURE) {
-#endif
accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 6eaa975..22e3151 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -92,7 +92,6 @@
#define PHP_5_3_X_API_NO 220090626
#define PHP_5_4_X_API_NO 220100525
#define PHP_5_5_X_API_NO 220121212
-#define PHP_5_6_X_API_NO 220131106
/*** file locking ***/
#ifndef ZEND_WIN32
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 01fd68b..4c2d850 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -474,17 +474,10 @@ static zend_module_entry accel_module_entry = {
STANDARD_MODULE_PROPERTIES
};
-#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
-int start_accel_module(TSRMLS_D)
-{
- return zend_startup_module(&accel_module_entry TSRMLS_CC);
-}
-#else
int start_accel_module(void)
{
return zend_startup_module(&accel_module_entry);
}
-#endif
/* {{{ proto array accelerator_get_scripts()
Get the scripts which are accelerated by ZendAccelerator */
diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h
index 6e772b8..ece4a7d 100644
--- a/ext/opcache/zend_accelerator_module.h
+++ b/ext/opcache/zend_accelerator_module.h
@@ -22,12 +22,7 @@
#ifndef ZEND_ACCELERATOR_MODULE_H
#define ZEND_ACCELERATOR_MODULE_H
-#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
-int start_accel_module(TSRMLS_D);
-#else
int start_accel_module(void);
-#endif
-
void zend_accel_override_file_functions(TSRMLS_D);
#endif /* _ZEND_ACCELERATOR_MODULE_H */
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index d1854ac..7021f9d 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -407,7 +407,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
if (stream->context && SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "no_ticket", &val) &&
- zend_is_true(*val TSRMLS_CC)
+ zend_is_true(*val)
) {
SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET);
}
@@ -420,7 +420,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
if (stream->context && SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "disable_compression", &val) &&
- zend_is_true(*val TSRMLS_CC)
+ zend_is_true(*val)
) {
SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_COMPRESSION);
}
@@ -452,10 +452,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
}
-static inline int php_openssl_enable_crypto(php_stream *stream,
- php_openssl_netstream_data_t *sslsock,
- php_stream_xport_crypto_param *cparam
- TSRMLS_DC)
+static inline int php_openssl_enable_crypto(php_stream *stream, php_openssl_netstream_data_t
*sslsock, php_stream_xport_crypto_param *cparam TSRMLS_DC)
{
int n, retry = 1;
@@ -466,12 +463,13 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
has_timeout = 0;
#if OPENSSL_VERSION_NUMBER >= 0x00908070L && !defined(OPENSSL_NO_TLSEXT)
-
+{
zval **val;
- if (sslsock->is_client
- && (php_stream_context_get_option(stream->context, "ssl",
"SNI_enabled", &val) == FAILURE
- || zend_is_true(*val TSRMLS_CC))
+ if (sslsock->is_client &&
+ stream->context &&
+ (php_stream_context_get_option(stream->context, "ssl", "SNI_enabled",
&val) == FAILURE
+ || zend_is_true(*val))
) {
if (php_stream_context_get_option(stream->context, "ssl",
"SNI_server_name", &val) == SUCCESS) {
convert_to_string_ex(val);
@@ -479,10 +477,13 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
} else if (sslsock->url_name) {
SSL_set_tlsext_host_name(sslsock->ssl_handle, sslsock->url_name);
}
+
+ } else if (sslsock->is_client && !stream->context && sslsock->url_name)
{
+ SSL_set_tlsext_host_name(sslsock->ssl_handle, sslsock->url_name);
}
+}
#endif
-
if (!sslsock->state_set) {
if (sslsock->is_client) {
SSL_set_connect_state(sslsock->ssl_handle);
@@ -578,7 +579,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl",
"capture_peer_cert", &val) &&
- zend_is_true(*val TSRMLS_CC)) {
+ zend_is_true(*val)) {
MAKE_STD_ZVAL(zcert);
ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert,
php_openssl_get_x509_list_id() TSRMLS_CC));
@@ -592,7 +593,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl",
"capture_peer_cert_chain", &val) &&
- zend_is_true(*val TSRMLS_CC)) {
+ zend_is_true(*val)) {
zval *arr;
STACK_OF(X509) *chain;