From d62b3a9d001031565b4b123e567a98ecbefd0b97 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 30 Aug 2006 12:07:04 +0000 Subject: [PATCH] - avoid a loop around deflate() by using Z_SYNC_FLUSH for standard write --- ext/zlib/zlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 2bf592c063..fc99d485f5 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -89,7 +89,7 @@ php_output_handler *php_zlib_output_handler_init(zval *handler_name TSRMLS_DC) int php_zlib_output_handler(void **handler_context, php_output_context *output_context) { php_zlib_context *ctx = *(php_zlib_context **) handler_context; - int flags = Z_NO_FLUSH, level; + int flags = Z_SYNC_FLUSH, status; PHP_OUTPUT_TSRMLS(output_context); if (!php_zlib_output_encoding(TSRMLS_C)) { @@ -147,10 +147,10 @@ int php_zlib_output_handler(void **handler_context, php_output_context *output_c if (output_context->op & PHP_OUTPUT_HANDLER_FINAL) { flags = Z_FINISH; } else if (output_context->op & PHP_OUTPUT_HANDLER_FLUSH) { - flags = Z_SYNC_FLUSH; + flags = Z_FULL_FLUSH; } - switch (deflate(&ctx->Z, flags)) { + switch ((status = deflate(&ctx->Z, flags))) { case Z_OK: if (flags == Z_FINISH) { deflateEnd(&ctx->Z); -- 2.50.1