From: Michael Wallner Date: Wed, 30 Aug 2006 14:42:01 +0000 (+0000) Subject: - add PHP_OUTPUT_WRITTEN and PHP_OUTPUT_SENT status flags X-Git-Tag: RELEASE_1_0_0RC1~1841 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e62c35f141d388936762ed1f9c8d42b91e1edf74;p=php - add PHP_OUTPUT_WRITTEN and PHP_OUTPUT_SENT status flags --- diff --git a/main/output.c b/main/output.c index 35aae5edd5..bb63c7accc 100644 --- a/main/output.c +++ b/main/output.c @@ -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); diff --git a/main/php_output.h b/main/php_output.h index 876b9924d3..8a4c8567a5 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -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 *p TSRMLS_DC); PHPAPI int php_output_get_level(TSRMLS_D); PHPAPI int php_output_start_default(TSRMLS_D);