]> granicus.if.org Git - php/commitdiff
Modified get_status(): Display chunk_size allways and size which is in
authorMarcus Boerger <helly@php.net>
Wed, 2 Oct 2002 15:10:11 +0000 (15:10 +0000)
committerMarcus Boerger <helly@php.net>
Wed, 2 Oct 2002 15:10:11 +0000 (15:10 +0000)
most cases initial_size as well as block_size only when used.

main/output.c

index bbf08072310498e0dcd5704e1baf3e86626d3502..9fdffdc9945a434dd577061e76febcdbaee7a5f1 100644 (file)
@@ -869,14 +869,17 @@ static int php_ob_buffer_status(php_ob_buffer *ob_buffer, zval *result)
                return FAILURE;
        }
 
+       add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size);
+       if (!ob_buffer->chunk_size) {
+               add_assoc_long(elem, "size", ob_buffer->size);
+               add_assoc_long(elem, "block_size", ob_buffer->block_size);
+       }
        if (ob_buffer->internal_output_handler) {
                add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_INTERNAL);
                add_assoc_long(elem, "buffer_size", ob_buffer->internal_output_handler_buffer_size);
        }
        else {
                add_assoc_long(elem, "type", PHP_OUTPUT_HANDLER_USER);
-               add_assoc_long(elem, "initial_size", ob_buffer->size);
-               add_assoc_long(elem, "chunk_size", ob_buffer->chunk_size);
        }
        add_assoc_long(elem, "status", ob_buffer->status);
        add_assoc_string(elem, "name", ob_buffer->handler_name, 1);