X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_encoding_api.c;h=f57add91cff00ce9c5a1ae6895db82961078e5d9;hp=f896be4ca8f57c701e5e7712f211934b0389e776;hb=52afbd9e2f860621ac40405d5c2298516493b121;hpb=7b88d9022c90eb12e5fe195af8644935141c9d68 diff --git a/http_encoding_api.c b/http_encoding_api.c index f896be4..f57add9 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -43,10 +43,12 @@ PHP_MINIT_FUNCTION(http_encoding) PHP_RINIT_FUNCTION(http_encoding) { - if (HTTP_G(send).inflate.start_auto) { + getGlobals(G); + + if (G->send.inflate.start_auto) { php_ob_set_internal_handler(_http_ob_inflatehandler, 0x1000, "http inflate", 0 TSRMLS_CC); } - if (HTTP_G(send).deflate.start_auto) { + if (G->send.deflate.start_auto) { php_ob_set_internal_handler(_http_ob_deflatehandler, 0x8000, "http deflate", 0 TSRMLS_CC); } return SUCCESS; @@ -54,6 +56,8 @@ PHP_RINIT_FUNCTION(http_encoding) PHP_RSHUTDOWN_FUNCTION(http_encoding) { + getGlobals(G); + if (G->send.deflate.stream) { http_encoding_deflate_stream_free((http_encoding_stream **) &G->send.deflate.stream); } @@ -657,7 +661,7 @@ void _http_ob_deflatehandler(char *output, uint output_len, char **handled_outpu break; } - flags |= (G->send.deflate.start_flags &~ 0xf); + flags |= (G->send.deflate.start_flags &~ 0xf0); G->send.deflate.stream = http_encoding_deflate_stream_init(NULL, flags); } @@ -695,7 +699,7 @@ void _http_ob_inflatehandler(char *output, uint output_len, char **handled_outpu zend_error(E_ERROR, "ob_inflatehandler() can only be used once"); return; } - G->send.inflate.stream = http_encoding_inflate_stream_init(NULL, (HTTP_G(send).inflate.start_flags &~ 0xf)); + G->send.inflate.stream = http_encoding_inflate_stream_init(NULL, (HTTP_G(send).inflate.start_flags &~ 0xf0)); } if (G->send.inflate.stream) {