summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_net.c
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2013-12-18 09:19:24 +0100
committerKalle Sommer Nielsen <kalle@php.net>2013-12-18 09:19:24 +0100
commitc83598119be083b572e92af292e9e9faa98d8d85 (patch)
tree2c0222ffdc86c783381ca571cce60eb52abe23c7 /ext/mysqlnd/mysqlnd_net.c
parentd02340bb39050c2ab0936bd8dc6a3292d6d2fcd9 (diff)
downloadphp-git-c83598119be083b572e92af292e9e9faa98d8d85.tar.gz
Kill a TSRMLS_FETCH() in php_stream_context_set() by passing TSRMLS_CC to it
# For mysqlnd: Relevant PHP_API_VERSION are put in place for cross version compatibility
Diffstat (limited to 'ext/mysqlnd/mysqlnd_net.c')
-rw-r--r--ext/mysqlnd/mysqlnd_net.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index fabceb4c8d..cb6d0dc3a7 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -900,7 +900,11 @@ 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)
{
@@ -916,7 +920,11 @@ 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;