From: Marcus Boerger Date: Wed, 2 Oct 2002 15:36:29 +0000 (+0000) Subject: Fix implicit_flush X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e6557f6644e8fe40e712d519f7cd9595119a073;p=php Fix implicit_flush --- diff --git a/NEWS b/NEWS index b829467a88..f6fb4aba08 100644 --- a/NEWS +++ b/NEWS @@ -5,7 +5,7 @@ PHP 4 NEWS {PREFIX}/bin/php. If you don't disable the CGI binary, it will be installed as {PREFIX}/bin/php-cgi. - Fixed bug #17825 (ob_start() chunk size option didn't work well). (Yasuo) -- Fixed output buffering implicit flush. (Yasuo) +- Fixed output buffering implicit flush. (Yasuo, Marcus) - Added getopt() for parsing command line options and arguments. (Jon) - Added pg_fetch_assoc(), pg_fetch_all(), pg_ping(), pg_meta_data(), pg_convert(), pg_insert(), pg_select(), pg_update(), pg_delete(), pg_data_seek() and diff --git a/main/output.c b/main/output.c index 9fdffdc994..35e8988a33 100644 --- a/main/output.c +++ b/main/output.c @@ -595,13 +595,11 @@ static void php_ob_append(const char *text, uint text_length TSRMLS_DC) /* If implicit_flush is On, send contents to next buffer and return. Both PG() and OG() should be used since we should flush implicitly always when implicit_flush is enabled in php.ini */ - if (PG(implicit_flush) || OG(implicit_flush)) { - php_end_ob_buffer(1, 1 TSRMLS_CC); - return; - } - - if (OG(active_ob_buffer).chunk_size - && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) { + if (PG(implicit_flush) || OG(implicit_flush) + /* Also flush after each chunk if output is chunked */ + || (OG(active_ob_buffer).chunk_size + && OG(active_ob_buffer).text_length >= OG(active_ob_buffer).chunk_size) + ) { zval *output_handler = OG(active_ob_buffer).output_handler; if (output_handler) {