summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index c3548eae53..ffde50ba0b 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -496,7 +496,6 @@ static PHP_FUNCTION(ob_gzhandler)
ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
}
- TSRMLS_SET_CTX(ctx.tsrm_ls);
ctx.op = flags;
ctx.in.data = in_str;
ctx.in.used = in_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
@@ -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;
}