From: Michael Wallner Date: Wed, 30 Aug 2006 12:07:04 +0000 (+0000) Subject: - avoid a loop around deflate() by using Z_SYNC_FLUSH for standard write X-Git-Tag: RELEASE_1_0_0RC1~1845 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d62b3a9d001031565b4b123e567a98ecbefd0b97;p=php - avoid a loop around deflate() by using Z_SYNC_FLUSH for standard write --- 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);