mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
- use TSRMLS_D/C with php_stream_context_alloc
This commit is contained in:
parent
daa90813fb
commit
ed58636f00
7 changed files with 20 additions and 11 deletions
|
@ -85,4 +85,13 @@ PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
|
||||||
|
|
||||||
it has to be called using:
|
it has to be called using:
|
||||||
|
|
||||||
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
|
|
||||||
|
h. php_stream_context_alloc
|
||||||
|
php_stream_context_alloc uses now TSRMLS_D:
|
||||||
|
|
||||||
|
PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D);
|
||||||
|
|
||||||
|
it has to be called using:
|
||||||
|
|
||||||
context = php_stream_context_alloc(TSRMLS_C);
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
|
|
|
@ -731,7 +731,7 @@ static enum_func_status
|
||||||
MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
|
MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
|
||||||
{
|
{
|
||||||
#ifdef MYSQLND_SSL_SUPPORTED
|
#ifdef MYSQLND_SSL_SUPPORTED
|
||||||
php_stream_context *context = php_stream_context_alloc();
|
php_stream_context *context = php_stream_context_alloc(TSRMLS_C);
|
||||||
DBG_ENTER("mysqlnd_net::enable_ssl");
|
DBG_ENTER("mysqlnd_net::enable_ssl");
|
||||||
if (!context) {
|
if (!context) {
|
||||||
DBG_RETURN(FAIL);
|
DBG_RETURN(FAIL);
|
||||||
|
|
|
@ -3222,7 +3222,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
|
||||||
"_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
|
"_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
|
||||||
context = php_stream_context_from_zval(*tmp, 0);
|
context = php_stream_context_from_zval(*tmp, 0);
|
||||||
} else {
|
} else {
|
||||||
context = php_stream_context_alloc();
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
|
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
|
||||||
|
@ -3245,7 +3245,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
|
||||||
smart_str_free(&proxy);
|
smart_str_free(&proxy);
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = php_stream_context_alloc();
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
php_stream_context_set_option(context, "http", "proxy", str_proxy);
|
php_stream_context_set_option(context, "http", "proxy", str_proxy);
|
||||||
zval_ptr_dtor(&str_proxy);
|
zval_ptr_dtor(&str_proxy);
|
||||||
|
@ -3274,7 +3274,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
|
||||||
zval *str_headers;
|
zval *str_headers;
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = php_stream_context_alloc();
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
|
|
||||||
smart_str_0(&headers);
|
smart_str_0(&headers);
|
||||||
|
|
|
@ -2524,7 +2524,7 @@ PHP_METHOD(SoapClient, SoapClient)
|
||||||
if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
|
if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
|
||||||
Z_TYPE_PP(tmp) == IS_STRING) {
|
Z_TYPE_PP(tmp) == IS_STRING) {
|
||||||
if (!context) {
|
if (!context) {
|
||||||
context = php_stream_context_alloc();
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
|
php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
|
||||||
if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
|
if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&
|
||||||
|
|
|
@ -966,7 +966,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
|
||||||
param, but then something is called which requires a context.
|
param, but then something is called which requires a context.
|
||||||
Don't give them the default one though since they already said they
|
Don't give them the default one though since they already said they
|
||||||
didn't want it. */
|
didn't want it. */
|
||||||
context = stream->context = php_stream_context_alloc();
|
context = stream->context = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1092,7 +1092,7 @@ PHP_FUNCTION(stream_context_get_default)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FG(default_context) == NULL) {
|
if (FG(default_context) == NULL) {
|
||||||
FG(default_context) = php_stream_context_alloc();
|
FG(default_context) = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
context = FG(default_context);
|
context = FG(default_context);
|
||||||
|
|
||||||
|
@ -1116,7 +1116,7 @@ PHP_FUNCTION(stream_context_set_default)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FG(default_context) == NULL) {
|
if (FG(default_context) == NULL) {
|
||||||
FG(default_context) = php_stream_context_alloc();
|
FG(default_context) = php_stream_context_alloc(TSRMLS_C);
|
||||||
}
|
}
|
||||||
context = FG(default_context);
|
context = FG(default_context);
|
||||||
|
|
||||||
|
@ -1137,7 +1137,7 @@ PHP_FUNCTION(stream_context_create)
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
context = php_stream_context_alloc();
|
context = php_stream_context_alloc(TSRMLS_C);
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
parse_context_options(context, options TSRMLS_CC);
|
parse_context_options(context, options TSRMLS_CC);
|
||||||
|
|
|
@ -680,7 +680,7 @@ PHP_FUNCTION(get_headers)
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc());
|
context = FG(default_context) ? FG(default_context) : (FG(default_context) = php_stream_context_alloc(TSRMLS_C));
|
||||||
|
|
||||||
if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) {
|
if (!(stream = php_stream_open_wrapper_ex(url, "r", REPORT_ERRORS | STREAM_USE_URL | STREAM_ONLY_GET_HEADERS, NULL, context))) {
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
|
|
|
@ -36,7 +36,7 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
|
||||||
(zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \
|
(zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \
|
||||||
(nocontext) ? NULL : \
|
(nocontext) ? NULL : \
|
||||||
FG(default_context) ? FG(default_context) : \
|
FG(default_context) ? FG(default_context) : \
|
||||||
(FG(default_context) = php_stream_context_alloc()) )
|
(FG(default_context) = php_stream_context_alloc(TSRMLS_C)) )
|
||||||
|
|
||||||
#define php_stream_context_to_zval(context, zval) { ZVAL_RESOURCE(zval, (context)->rsrc_id); zend_list_addref((context)->rsrc_id); }
|
#define php_stream_context_to_zval(context, zval) { ZVAL_RESOURCE(zval, (context)->rsrc_id); zend_list_addref((context)->rsrc_id); }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue