zeev            Tue Mar  6 10:29:00 2001 EDT

  Modified files:              
    /php4/ext/standard  output.c 
  Log:
  Fixes to internal output buffering
  
  
Index: php4/ext/standard/output.c
diff -u php4/ext/standard/output.c:1.46 php4/ext/standard/output.c:1.47
--- php4/ext/standard/output.c:1.46     Tue Mar  6 08:28:51 2001
+++ php4/ext/standard/output.c  Tue Mar  6 10:29:00 2001
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: output.c,v 1.46 2001/03/06 16:28:51 zeev Exp $ */
+/* $Id: output.c,v 1.47 2001/03/06 18:29:00 zeev Exp $ */
 
 #include "php.h"
 #include "ext/standard/head.h"
@@ -122,7 +122,7 @@
        char *final_buffer=NULL;
        int final_buffer_length=0;
        zval *alternate_buffer=NULL;
-       char *to_be_destroyed_buffer;
+       char *to_be_destroyed_buffer, *to_be_destroyed_output_buffer;
        int status;
        SLS_FETCH();
        OLS_FETCH();
@@ -193,12 +193,9 @@
        }
 
        to_be_destroyed_buffer = OG(active_ob_buffer).buffer;
+       to_be_destroyed_output_buffer = 
+OG(active_ob_buffer).internal_output_handler_buffer;
 
        if (!just_flush) {
-               if (OG(active_ob_buffer).internal_output_handler
-                       && (final_buffer != 
OG(active_ob_buffer).internal_output_handler_buffer)) {
-                       efree(final_buffer);
-               }
                if (OG(nesting_level)>1) { /* restore previous buffer */
                        php_ob_buffer *ob_buffer_p;
 
@@ -222,11 +219,18 @@
        if (!just_flush) {
                efree(to_be_destroyed_buffer);
 
+               if (to_be_destroyed_output_buffer) {
+                       efree(to_be_destroyed_output_buffer);
+               }
                OG(nesting_level)--;
        } else {
                OG(active_ob_buffer).text_length = 0;
                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
+                       && final_buffer != 
+OG(active_ob_buffer).internal_output_handler_buffer) {
+                       efree(final_buffer);
+               }
        }
 }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to