summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-05-02 06:50:18 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-05-02 06:50:18 +0000
commit1103311eee7ac19515aafdffda44dad7635f841b (patch)
treebb3397b953fa580fc5840724dccfbc3726ff52b6
parentb2579d3480226f540efd0c50e0fc54ef5dd91a86 (diff)
downloadphp-git-1103311eee7ac19515aafdffda44dad7635f841b.tar.gz
Fixed header output. Only need to output header when it is actually sent to client.
-rw-r--r--main/output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/output.c b/main/output.c
index 288b7c0469..093519f342 100644
--- a/main/output.c
+++ b/main/output.c
@@ -211,9 +211,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
if (SG(headers_sent) && !SG(request_info).headers_only) {
OG(php_body_write) = php_ub_body_write_no_header;
} else {
- /* Set Content-Length only if unerasable */
- if (!OG(active_ob_buffer).erase && status == (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_END))
- ADD_CL_HEADER(OG(active_ob_buffer).text_length);
OG(php_body_write) = php_ub_body_write;
}
}
@@ -242,6 +239,9 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
OG(ob_nesting_level)--;
if (send_buffer) {
+ /* FIXME: It's better to make it work with the last buffer */
+ if (OG(ob_nesting_level) == 1 && status == (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_END))
+ ADD_CL_HEADER(final_buffer_length);
OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC);
}