]> granicus.if.org Git - php/commitdiff
- add PHP_OUTPUT_WRITTEN and PHP_OUTPUT_SENT status flags
authorMichael Wallner <mike@php.net>
Wed, 30 Aug 2006 14:42:01 +0000 (14:42 +0000)
committerMichael Wallner <mike@php.net>
Wed, 30 Aug 2006 14:42:01 +0000 (14:42 +0000)
main/output.c
main/php_output.h

index 35aae5edd5a445bb4c0500c6aa531560bd183326..bb63c7acccc212cc71879a6f28a90babf773a68e 100644 (file)
@@ -863,6 +863,7 @@ static inline php_output_handler *php_output_handler_init(zval *name, size_t chu
 static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf TSRMLS_DC)
 {
        if (buf->used) {
+               OG(flags) |= PHP_OUTPUT_WRITTEN;
                /* store it away */
                if ((handler->buffer.size - handler->buffer.used) <= buf->used) {
                        size_t grow_int = PHP_OUTPUT_HANDLER_INITBUF_SIZE(handler->size);
@@ -1069,6 +1070,7 @@ static inline void php_output_op(int op, const char *str, size_t len TSRMLS_DC)
                        if (OG(flags) & PHP_OUTPUT_IMPLICITFLUSH) {
                                sapi_flush(TSRMLS_C);
                        }
+                       OG(flags) |= PHP_OUTPUT_SENT;
                }
        }
        php_output_context_dtor(&context);
index 876b9924d36a83fe27957748eb6d454a99f04b78..8a4c8567a5783d032056269385d19dec4f7118ee 100644 (file)
@@ -60,6 +60,8 @@
 /* real global flags */
 #define PHP_OUTPUT_IMPLICITFLUSH               0x01
 #define PHP_OUTPUT_DISABLED                            0x02
+#define PHP_OUTPUT_WRITTEN                             0x04
+#define PHP_OUTPUT_SENT                                        0x08
 /* supplementary flags for php_output_get_status() */
 #define PHP_OUTPUT_ACTIVE                              0x10
 #define PHP_OUTPUT_LOCKED                              0x20
@@ -205,7 +207,7 @@ PHPAPI int php_output_discard(TSRMLS_D);
 PHPAPI void php_output_discard_all(TSRMLS_D);
 
 PHPAPI int php_output_get_contents(zval *p TSRMLS_DC);
-PHPAPI int php_output_get_length(zval *TSRMLS_DC);
+PHPAPI int php_output_get_length(zval *TSRMLS_DC);
 PHPAPI int php_output_get_level(TSRMLS_D);
 
 PHPAPI int php_output_start_default(TSRMLS_D);