]> granicus.if.org Git - php/commitdiff
Fix internal output buffering
authorZeev Suraski <zeev@php.net>
Tue, 6 Mar 2001 16:25:14 +0000 (16:25 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 6 Mar 2001 16:25:14 +0000 (16:25 +0000)
ext/standard/output.c
ext/standard/php_output.h
main/output.c
main/php_output.h

index 02c85756174116b47269cbedfde053bcfeb97d80..6055439725b77aa73c16a01ae2c893c1fd6467b6 100644 (file)
@@ -195,6 +195,10 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
        to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
 
        if (!just_flush) {
+               if (OG(active_ob_buffer).internal_output_handler
+                       && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
+                       efree(internal_output_handler_buffer);
+               }
                if (OG(nesting_level)>1) { /* restore previous buffer */
                        php_ob_buffer *ob_buffer_p;
 
@@ -224,10 +228,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
                OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
                OG(php_body_write) = php_b_body_write;
        }
-       if (OG(active_ob_buffer).internal_output_handler
-               && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
-               efree(internal_output_handler_buffer);
-       }
 }
 
 
index 0cb8647690c09cfcc7f846165dc971fb256afd79..3bfd5d078c5fa8864a680834a6907a19caa8f191 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "php.h"
 
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int status);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int mode);
 
 PHPAPI void php_output_startup(void);
 void php_output_register_constants(void);
index 02c85756174116b47269cbedfde053bcfeb97d80..6055439725b77aa73c16a01ae2c893c1fd6467b6 100644 (file)
@@ -195,6 +195,10 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
        to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
 
        if (!just_flush) {
+               if (OG(active_ob_buffer).internal_output_handler
+                       && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
+                       efree(internal_output_handler_buffer);
+               }
                if (OG(nesting_level)>1) { /* restore previous buffer */
                        php_ob_buffer *ob_buffer_p;
 
@@ -224,10 +228,6 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush)
                OG(active_ob_buffer).status |= PHP_OUTPUT_HANDLER_START;
                OG(php_body_write) = php_b_body_write;
        }
-       if (OG(active_ob_buffer).internal_output_handler
-               && (internal_output_handler_buffer != OG(active_ob_buffer).internal_output_handler_buffer)) {
-               efree(internal_output_handler_buffer);
-       }
 }
 
 
index 0cb8647690c09cfcc7f846165dc971fb256afd79..3bfd5d078c5fa8864a680834a6907a19caa8f191 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "php.h"
 
-typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int status);
+typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, int mode);
 
 PHPAPI void php_output_startup(void);
 void php_output_register_constants(void);