|
15 | 15 | #include <Zend/zend_interfaces.h>
|
16 | 16 | #include "php_brotli.h"
|
17 | 17 |
|
18 |
| -int le_state; |
19 |
| - |
20 | 18 | # pragma GCC diagnostic ignored "-Wpointer-sign"
|
21 | 19 |
|
22 | 20 | ZEND_DECLARE_MODULE_GLOBALS(brotli);
|
@@ -133,35 +131,6 @@ static int php_brotli_decoder_create(BrotliDecoderState **decoder)
|
133 | 131 | return SUCCESS;
|
134 | 132 | }
|
135 | 133 |
|
136 |
| -static php_brotli_state_context* php_brotli_state_init(void) |
137 |
| -{ |
138 |
| - php_brotli_state_context *ctx |
139 |
| - = (php_brotli_state_context *)ecalloc(1, |
140 |
| - sizeof(php_brotli_state_context)); |
141 |
| - ctx->encoder = NULL; |
142 |
| - ctx->decoder = NULL; |
143 |
| - return ctx; |
144 |
| -} |
145 |
| - |
146 |
| -static void php_brotli_state_destroy(php_brotli_state_context *ctx) |
147 |
| -{ |
148 |
| - if (ctx->encoder) { |
149 |
| - BrotliEncoderDestroyInstance(ctx->encoder); |
150 |
| - ctx->encoder = NULL; |
151 |
| - } |
152 |
| - if (ctx->decoder) { |
153 |
| - BrotliDecoderDestroyInstance(ctx->decoder); |
154 |
| - ctx->decoder = NULL; |
155 |
| - } |
156 |
| - efree(ctx); |
157 |
| -} |
158 |
| - |
159 |
| -static void php_brotli_state_rsrc_dtor(zend_resource *res) |
160 |
| -{ |
161 |
| - php_brotli_state_context *ctx = zend_fetch_resource(res, NULL, le_state); |
162 |
| - php_brotli_state_destroy(ctx); |
163 |
| -} |
164 |
| - |
165 | 134 | #define PHP_BROTLI_OUTPUT_HANDLER "ob_brotli_handler"
|
166 | 135 |
|
167 | 136 | static int php_brotli_output_encoding(void)
|
@@ -1015,10 +984,6 @@ ZEND_MINIT_FUNCTION(brotli)
|
1015 | 984 | REGISTER_LONG_CONSTANT("BROTLI_FINISH", BROTLI_OPERATION_FINISH,
|
1016 | 985 | CONST_CS | CONST_PERSISTENT);
|
1017 | 986 |
|
1018 |
| - le_state = zend_register_list_destructors_ex(php_brotli_state_rsrc_dtor, |
1019 |
| - NULL, "brotli.state", |
1020 |
| - module_number); |
1021 |
| - |
1022 | 987 | php_output_handler_alias_register(ZEND_STRL(PHP_BROTLI_OUTPUT_HANDLER),
|
1023 | 988 | php_brotli_output_handler_init);
|
1024 | 989 | php_output_handler_conflict_register(ZEND_STRL(PHP_BROTLI_OUTPUT_HANDLER),
|
|
0 commit comments