Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit).

This commit is contained in:
Ilia Alshanetsky 2008-09-17 00:20:30 +00:00
parent 2c98da2d17
commit fcc0fdd125
2 changed files with 7 additions and 1 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ PHP NEWS
- Fixed bug #45928 (large scripts from stdin are stripped at 16K border).
(Christian Schneider, Arnaud)
- Fixed bug #45911 (Cannot disable ext/hash). (Arnaud)
- Fixed bug #45392 (ob_start()/ob_end_clean() and memory_limit). (Ilia)
- Fixed bug #45382 (timeout bug in stream_socket_enable_crypto).
(vnegrier at optilian dot com, Ilia

View File

@ -1478,7 +1478,12 @@ void php_request_shutdown(void *dummy)
/* 3. Flush all output buffers */
zend_try {
php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);
zend_bool send_buffer = SG(request_info).headers_only ? 0 : 1;
if (CG(unclean_shutdown) && PG(last_error_type) == E_ERROR &&
!OG(active_ob_buffer).chunk_size && PG(memory_limit) < zend_memory_usage(1 TSRMLS_CC)) {
send_buffer = 0;
}
php_end_ob_buffers(send_buffer TSRMLS_CC);
} zend_end_try();
/* 4. Send the set HTTP headers (note: This must be done AFTER php_end_ob_buffers() !!) */