- use TSRMLS_D/C with php_stream_context_alloc

This commit is contained in:
Pierre Joye 2010-09-16 09:33:42 +00:00
parent daa90813fb
commit ed58636f00
7 changed files with 20 additions and 11 deletions

View file

@ -85,4 +85,13 @@ PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
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);

View file

@ -731,7 +731,7 @@ static enum_func_status
MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
{
#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");
if (!context) {
DBG_RETURN(FAIL);

View file

@ -3222,7 +3222,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
"_stream_context", sizeof("_stream_context"), (void**)&tmp)) {
context = php_stream_context_from_zval(*tmp, 0);
} 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 &&
@ -3245,7 +3245,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
smart_str_free(&proxy);
if (!context) {
context = php_stream_context_alloc();
context = php_stream_context_alloc(TSRMLS_C);
}
php_stream_context_set_option(context, "http", "proxy", 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;
if (!context) {
context = php_stream_context_alloc();
context = php_stream_context_alloc(TSRMLS_C);
}
smart_str_0(&headers);

View file

@ -2524,7 +2524,7 @@ PHP_METHOD(SoapClient, SoapClient)
if (zend_hash_find(ht, "local_cert", sizeof("local_cert"), (void**)&tmp) == SUCCESS &&
Z_TYPE_PP(tmp) == IS_STRING) {
if (!context) {
context = php_stream_context_alloc();
context = php_stream_context_alloc(TSRMLS_C);
}
php_stream_context_set_option(context, "ssl", "local_cert", *tmp);
if (zend_hash_find(ht, "passphrase", sizeof("passphrase"), (void**)&tmp) == SUCCESS &&

View file

@ -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.
Don't give them the default one though since they already said they
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) {
FG(default_context) = php_stream_context_alloc();
FG(default_context) = php_stream_context_alloc(TSRMLS_C);
}
context = FG(default_context);
@ -1116,7 +1116,7 @@ PHP_FUNCTION(stream_context_set_default)
}
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);
@ -1137,7 +1137,7 @@ PHP_FUNCTION(stream_context_create)
RETURN_FALSE;
}
context = php_stream_context_alloc();
context = php_stream_context_alloc(TSRMLS_C);
if (options) {
parse_context_options(context, options TSRMLS_CC);

View file

@ -680,7 +680,7 @@ PHP_FUNCTION(get_headers)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &url, &url_len, &format) == FAILURE) {
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))) {
RETURN_FALSE;

View file

@ -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)) : \
(nocontext) ? NULL : \
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); }