summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-12-18 10:09:02 +0100
committerAnatol Belski <ab@php.net>2014-12-18 10:09:02 +0100
commit4b943c9c0dd4114adc78416c5241f11ad5c98a80 (patch)
treec9628d91eae3f580f9ebd73d2372e4c9089b2e00 /ext/zlib/zlib.c
parent79354ba6d0d6a1a4596f9ac66ee9bc3a34ed972b (diff)
parentdec8eb431adee340fb8dfb9ff33ed29d3279c35f (diff)
downloadphp-git-POST_NATIVE_TLS_MERGE.tar.gz
Merge remote-tracking branch 'origin/native-tls'POST_NATIVE_TLS_MERGE
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c145
1 files changed, 75 insertions, 70 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index c3548eae53..3f66ed106d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -62,13 +62,13 @@ static void php_zlib_free(voidpf opaque, voidpf address)
/* }}} */
/* {{{ php_zlib_output_conflict_check() */
-static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C) > 0) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter") TSRMLS_CC)) {
+ if (php_output_get_level() > 0) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter"))) {
return FAILURE;
}
}
@@ -77,13 +77,13 @@ static int php_zlib_output_conflict_check(const char *handler_name, size_t handl
/* }}} */
/* {{{ php_zlib_output_encoding() */
-static int php_zlib_output_encoding(TSRMLS_D)
+static int php_zlib_output_encoding(void)
{
zval *enc;
if (!ZLIBG(compression_coding)) {
zend_string *name = zend_string_init("_SERVER", sizeof("_SERVER") - 1, 0);
- zend_is_auto_global(name TSRMLS_CC);
+ zend_is_auto_global(name);
zend_string_release(name);
if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY &&
(enc = zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING") - 1))) {
@@ -191,7 +191,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
php_zlib_context *ctx = *(php_zlib_context **) handler_context;
PHP_OUTPUT_TSRMLS(output_context);
- if (!php_zlib_output_encoding(TSRMLS_C)) {
+ if (!php_zlib_output_encoding()) {
/* "Vary: Accept-Encoding" header sent along uncompressed content breaks caching in MSIE,
so let's just send it with successfully compressed content or unless the complete
buffer gets discarded, see http://bugs.php.net/40325;
@@ -205,7 +205,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if ((output_context->op & PHP_OUTPUT_HANDLER_START)
&& (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL))
) {
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
return FAILURE;
}
@@ -217,7 +217,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
if (!(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
int flags;
- if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags TSRMLS_CC)) {
+ if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags)) {
/* only run this once */
if (!(flags & PHP_OUTPUT_HANDLER_STARTED)) {
if (SG(headers_sent) || !ZLIBG(output_compression)) {
@@ -226,17 +226,17 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
}
switch (ZLIBG(compression_coding)) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
default:
deflateEnd(&ctx->Z);
return FAILURE;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -246,7 +246,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
/* }}} */
/* {{{ php_zlib_output_handler_context_init() */
-static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
+static php_zlib_context *php_zlib_output_handler_context_init(void)
{
php_zlib_context *ctx = (php_zlib_context *) ecalloc(1, sizeof(php_zlib_context));
ctx->Z.zalloc = php_zlib_alloc;
@@ -256,7 +256,7 @@ static php_zlib_context *php_zlib_output_handler_context_init(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_output_handler_context_dtor() */
-static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
+static void php_zlib_output_handler_context_dtor(void *opaq)
{
php_zlib_context *ctx = (php_zlib_context *) opaq;
@@ -270,7 +270,7 @@ static void php_zlib_output_handler_context_dtor(void *opaq TSRMLS_DC)
/* }}} */
/* {{{ php_zlib_output_handler_init() */
-static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_zlib_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
php_output_handler *h = NULL;
@@ -280,8 +280,8 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
ZLIBG(handler_registered) = 1;
- if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) {
- php_output_handler_set_context(h, php_zlib_output_handler_context_init(TSRMLS_C), php_zlib_output_handler_context_dtor TSRMLS_CC);
+ if ((h = php_output_handler_create_internal(handler_name, handler_name_len, php_zlib_output_handler, chunk_size, flags))) {
+ php_output_handler_set_context(h, php_zlib_output_handler_context_init(), php_zlib_output_handler_context_dtor);
}
return h;
@@ -289,7 +289,7 @@ static php_output_handler *php_zlib_output_handler_init(const char *handler_name
/* }}} */
/* {{{ php_zlib_output_compression_start() */
-static void php_zlib_output_compression_start(TSRMLS_D)
+static void php_zlib_output_compression_start(void)
{
zval zoh;
php_output_handler *h;
@@ -301,12 +301,12 @@ static void php_zlib_output_compression_start(TSRMLS_D)
ZLIBG(output_compression) = PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
/* break omitted intentionally */
default:
- if ( php_zlib_output_encoding(TSRMLS_C) &&
- (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) &&
- (SUCCESS == php_output_handler_start(h TSRMLS_CC))) {
+ if ( php_zlib_output_encoding() &&
+ (h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS)) &&
+ (SUCCESS == php_output_handler_start(h))) {
if (ZLIBG(output_handler) && *ZLIBG(output_handler)) {
ZVAL_STRING(&zoh, ZLIBG(output_handler));
- php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
+ php_output_start_user(&zoh, ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS);
zval_ptr_dtor(&zoh);
}
}
@@ -316,7 +316,7 @@ static void php_zlib_output_compression_start(TSRMLS_D)
/* }}} */
/* {{{ php_zlib_encode() */
-static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level TSRMLS_DC)
+static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encoding, int level)
{
int status;
z_stream Z;
@@ -347,7 +347,7 @@ static zend_string *php_zlib_encode(const char *in_buf, size_t in_len, int encod
}
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return NULL;
}
/* }}} */
@@ -402,7 +402,7 @@ static inline int php_zlib_inflate_rounds(z_stream *Z, size_t max, char **buf, s
/* }}} */
/* {{{ php_zlib_decode() */
-static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len TSRMLS_DC)
+static int php_zlib_decode(const char *in_buf, size_t in_len, char **out_buf, size_t *out_len, int encoding, size_t max_len)
{
int status = Z_DATA_ERROR;
z_stream Z;
@@ -438,17 +438,17 @@ retry_raw_inflate:
*out_buf = NULL;
*out_len = 0;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status));
+ php_error_docref(NULL, E_WARNING, "%s", zError(status));
return FAILURE;
}
/* }}} */
/* {{{ php_zlib_cleanup_ob_gzhandler_mess() */
-static void php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_D)
+static void php_zlib_cleanup_ob_gzhandler_mess(void)
{
if (ZLIBG(ob_gzhandler)) {
deflateEnd(&(ZLIBG(ob_gzhandler)->Z));
- php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler) TSRMLS_CC);
+ php_zlib_output_handler_context_dtor(ZLIBG(ob_gzhandler));
ZLIBG(ob_gzhandler) = NULL;
}
}
@@ -472,31 +472,30 @@ static PHP_FUNCTION(ob_gzhandler)
* - OG(running) is not set or set to any other output handler
* - we have to mess around with php_output_context */
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &in_str, &in_len, &flags)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "sl", &in_str, &in_len, &flags)) {
RETURN_FALSE;
}
- if (!(encoding = php_zlib_output_encoding(TSRMLS_C))) {
+ if (!(encoding = php_zlib_output_encoding())) {
RETURN_FALSE;
}
if (flags & PHP_OUTPUT_HANDLER_START) {
switch (encoding) {
case PHP_ZLIB_ENCODING_GZIP:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: gzip"), 1, 1);
break;
case PHP_ZLIB_ENCODING_DEFLATE:
- sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1);
break;
}
- sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0);
}
if (!ZLIBG(ob_gzhandler)) {
- ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
+ ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init();
}
- TSRMLS_SET_CTX(ctx.tsrm_ls);
ctx.op = flags;
ctx.in.data = in_str;
ctx.in.used = in_len;
@@ -507,7 +506,7 @@ static PHP_FUNCTION(ob_gzhandler)
if (ctx.out.data && ctx.out.free) {
efree(ctx.out.data);
}
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
RETURN_FALSE;
}
@@ -552,7 +551,7 @@ static PHP_FUNCTION(gzfile)
zend_long use_include_path = 0;
php_stream *stream;
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|l", &filename, &filename_len, &use_include_path)) {
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &filename, &filename_len, &use_include_path)) {
return;
}
@@ -561,7 +560,7 @@ static PHP_FUNCTION(gzfile)
}
/* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
/* Error reporting is already done by stream code */
@@ -592,7 +591,7 @@ static PHP_FUNCTION(gzopen)
php_stream *stream;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAILURE) {
return;
}
@@ -600,7 +599,7 @@ static PHP_FUNCTION(gzopen)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, mode, flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -620,7 +619,7 @@ static PHP_FUNCTION(readgzfile)
size_t size;
zend_long use_include_path = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &filename, &filename_len, &use_include_path) == FAILURE) {
return;
}
@@ -628,7 +627,7 @@ static PHP_FUNCTION(readgzfile)
flags |= USE_PATH;
}
- stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC TSRMLS_CC);
+ stream = php_stream_gzopen(NULL, filename, "rb", flags, NULL, NULL STREAMS_CC);
if (!stream) {
RETURN_FALSE;
@@ -646,16 +645,16 @@ static PHP_FUNCTION(name) \
zend_long level = -1; \
zend_long encoding = default_encoding; \
if (default_encoding) { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ll", &in, &level, &encoding)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S|ll", &in, &level, &encoding)) { \
return; \
} \
} else { \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|l", &in, &encoding, &level)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &in, &encoding, &level)) { \
return; \
} \
} \
if (level < -1 || level > 9) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%pd) must be within -1..9", level); \
+ php_error_docref(NULL, E_WARNING, "compression level (%pd) must be within -1..9", level); \
RETURN_FALSE; \
} \
switch (encoding) { \
@@ -664,10 +663,10 @@ static PHP_FUNCTION(name) \
case PHP_ZLIB_ENCODING_DEFLATE: \
break; \
default: \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
+ php_error_docref(NULL, E_WARNING, "encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE"); \
RETURN_FALSE; \
} \
- if ((out = php_zlib_encode(in->val, in->len, encoding, level TSRMLS_CC)) == NULL) { \
+ if ((out = php_zlib_encode(in->val, in->len, encoding, level)) == NULL) { \
RETURN_FALSE; \
} \
RETURN_STR(out); \
@@ -680,14 +679,14 @@ static PHP_FUNCTION(name) \
size_t in_len; \
size_t out_len; \
zend_long max_len = 0; \
- if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &in_buf, &in_len, &max_len)) { \
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &in_buf, &in_len, &max_len)) { \
return; \
} \
if (max_len < 0) { \
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
+ php_error_docref(NULL, E_WARNING, "length (%pd) must be greater or equal zero", max_len); \
RETURN_FALSE; \
} \
- if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len TSRMLS_CC)) { \
+ if (SUCCESS != php_zlib_decode(in_buf, in_len, &out_buf, &out_len, encoding, max_len)) { \
RETURN_FALSE; \
} \
RETVAL_STRINGL(out_buf, out_len); \
@@ -736,6 +735,9 @@ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE);
/* }}} */
#ifdef COMPILE_DL_ZLIB
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(php_zlib)
#endif
@@ -900,13 +902,13 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0);
if (ini_value && *ini_value && int_value) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
+ php_error_docref("ref.outcontrol", E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!");
return FAILURE;
}
if (stage == PHP_INI_STAGE_RUNTIME) {
- int status = php_output_get_status(TSRMLS_C);
+ int status = php_output_get_status();
if (status & PHP_OUTPUT_SENT) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_compression - headers already sent");
return FAILURE;
}
}
@@ -916,8 +918,8 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
ZLIBG(output_compression) = ZLIBG(output_compression_default);
if (stage == PHP_INI_STAGE_RUNTIME && int_value) {
- if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)) {
- php_zlib_output_compression_start(TSRMLS_C);
+ if (!php_output_handler_started(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME))) {
+ php_zlib_output_compression_start();
}
}
@@ -928,12 +930,12 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
/* {{{ OnUpdate_zlib_output_handler */
static PHP_INI_MH(OnUpdate_zlib_output_handler)
{
- if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status(TSRMLS_C) & PHP_OUTPUT_SENT)) {
- php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent");
+ if (stage == PHP_INI_STAGE_RUNTIME && (php_output_get_status() & PHP_OUTPUT_SENT)) {
+ php_error_docref("ref.outcontrol", E_WARNING, "Cannot change zlib.output_handler - headers already sent");
return FAILURE;
}
- return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
}
/* }}} */
@@ -949,12 +951,12 @@ PHP_INI_END()
/* {{{ PHP_MINIT_FUNCTION */
static PHP_MINIT_FUNCTION(zlib)
{
- php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC);
- php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC);
+ php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper);
+ php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory);
- php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check);
+ php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check);
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);
@@ -970,8 +972,8 @@ static PHP_MINIT_FUNCTION(zlib)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
static PHP_MSHUTDOWN_FUNCTION(zlib)
{
- php_unregister_url_stream_wrapper("zlib" TSRMLS_CC);
- php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC);
+ php_unregister_url_stream_wrapper("zlib");
+ php_stream_filter_unregister_factory("zlib.*");
UNREGISTER_INI_ENTRIES();
@@ -985,7 +987,7 @@ static PHP_RINIT_FUNCTION(zlib)
ZLIBG(compression_coding) = 0;
if (!ZLIBG(handler_registered)) {
ZLIBG(output_compression) = ZLIBG(output_compression_default);
- php_zlib_output_compression_start(TSRMLS_C);
+ php_zlib_output_compression_start();
}
return SUCCESS;
@@ -995,7 +997,7 @@ static PHP_RINIT_FUNCTION(zlib)
/* {{{ PHP_RSHUTDOWN_FUNCTION */
static PHP_RSHUTDOWN_FUNCTION(zlib)
{
- php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ php_zlib_cleanup_ob_gzhandler_mess();
ZLIBG(handler_registered) = 0;
return SUCCESS;
@@ -1020,6 +1022,9 @@ static PHP_MINFO_FUNCTION(zlib)
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
static PHP_GINIT_FUNCTION(zlib)
{
+#if defined(COMPILE_DL_ZLIB) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE;
+#endif
zlib_globals->ob_gzhandler = NULL;
zlib_globals->handler_registered = 0;
}