cvs: php4 /ext/standard url_scanner_ex.c url_scanner_ex.re /ext/zlib zlib.c /main output.c
| From: | Marcus B�rger | Date: | Sat, 10 Aug 2002 16:12:37 +0000 |
| Subject: | cvs: php4 /ext/standard url_scanner_ex.c url_scanner_ex.re /ext/zlib zlib.c /main output.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13246@lists.php.net to get a copy of this message | ||
helly Sat Aug 10 12:12:37 2002 EDT
Modified files:
/php4/main output.c
/php4/ext/standard url_scanner_ex.c url_scanner_ex.re
/php4/ext/zlib zlib.c
Log:
corrected handling of internal output buffers
minor fixs
Index: php4/main/output.c
diff -u php4/main/output.c:1.106 php4/main/output.c:1.107
--- php4/main/output.c:1.106 Fri Aug 9 18:29:57 2002
+++ php4/main/output.c Sat Aug 10 12:12:36 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.106 2002/08/09 22:29:57 helly Exp $ */
+/* $Id: output.c,v 1.107 2002/08/10 16:12:36 helly Exp $ */
#include "php.h"
#include "ext/standard/head.h"
@@ -26,6 +26,8 @@
#include "ext/standard/url_scanner_ex.h"
#include "SAPI.h"
+#define OB_DEFAULT_HANDLER_NAME "default output handler"
+
/* output functions */
static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC);
static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC);
@@ -325,8 +327,8 @@
*/
PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint
buffer_size, char *handler_name, zend_bool erase TSRMLS_DC)
{
- if (OG(ob_nesting_level)==0) {
- return;
+ if (OG(ob_nesting_level)==0 || OG(active_ob_buffer).internal_output_handler ||
strcmp(OG(active_ob_buffer).handler_name, OB_DEFAULT_HANDLER_NAME)) {
+ php_start_ob_buffer(NULL, buffer_size, erase TSRMLS_CC);
}
OG(active_ob_buffer).internal_output_handler = internal_output_handler;
@@ -409,7 +411,7 @@
OG(active_ob_buffer).chunk_size = chunk_size;
OG(active_ob_buffer).status = 0;
OG(active_ob_buffer).internal_output_handler = NULL;
- OG(active_ob_buffer).handler_name =
estrdup(handler_name&&handler_name[0]?handler_name:"default output handler");
+ OG(active_ob_buffer).handler_name =
estrdup(handler_name&&handler_name[0]?handler_name:OB_DEFAULT_HANDLER_NAME);
OG(active_ob_buffer).erase = erase;
OG(php_body_write) = php_b_body_write;
return SUCCESS;
@@ -480,7 +482,7 @@
SEPARATE_ZVAL(&output_handler);
output_handler->refcount++;
}
- result = php_ob_init_named(initial_size, block_size, "default output handler",
output_handler, chunk_size, erase TSRMLS_CC);
+ result = php_ob_init_named(initial_size, block_size, OB_DEFAULT_HANDLER_NAME, output_handler,
chunk_size, erase TSRMLS_CC);
}
return result;
}
@@ -495,19 +497,19 @@
}
/* }}} */
-/* {{{ proto array ob_list_handlers()
+/* {{{ proto false|array ob_list_handlers()
* List all output_buffers in an array
*/
PHP_FUNCTION(ob_list_handlers)
{
if (ZEND_NUM_ARGS()!=0) {
WRONG_PARAM_COUNT;
- return;
+ RETURN_FALSE;
}
if (array_init(return_value) == FAILURE) {
php_error(E_ERROR, "%s(): Unable to initialize array",
get_active_function_name(TSRMLS_C));
- return;
+ RETURN_FALSE;
}
if (OG(ob_nesting_level)) {
if (OG(ob_nesting_level)>1) {
Index: php4/ext/standard/url_scanner_ex.c
diff -u php4/ext/standard/url_scanner_ex.c:1.67 php4/ext/standard/url_scanner_ex.c:1.68
--- php4/ext/standard/url_scanner_ex.c:1.67 Sat Jun 29 07:13:03 2002
+++ php4/ext/standard/url_scanner_ex.c Sat Aug 10 12:12:36 2002
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.5 on Sat Jun 29 13:09:10 2002 */
-#line 1 "/home/thies/devel/php4/ext/standard/url_scanner_ex.re"
+/* Generated by re2c 0.5 on Sat Aug 10 17:30:38 2002 */
+#line 1 "/usr/src/php4/ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
@@ -889,7 +889,6 @@
int chunk_size = 4096; /* XXX where should we get chunk_size from? */
php_url_scanner_ex_activate(TSRMLS_C);
- php_start_ob_buffer(NULL, chunk_size, 1 TSRMLS_CC);
php_ob_set_internal_handler(php_url_scanner_output_handler, chunk_size, "URL-Rewriter",
1 TSRMLS_CC);
BG(url_adapt_state_ex).active = 1;
}
Index: php4/ext/standard/url_scanner_ex.re
diff -u php4/ext/standard/url_scanner_ex.re:1.57 php4/ext/standard/url_scanner_ex.re:1.58
--- php4/ext/standard/url_scanner_ex.re:1.57 Sat Jun 29 07:12:57 2002
+++ php4/ext/standard/url_scanner_ex.re Sat Aug 10 12:12:36 2002
@@ -405,7 +405,6 @@
int chunk_size = 4096; /* XXX where should we get chunk_size from? */
php_url_scanner_ex_activate(TSRMLS_C);
- php_start_ob_buffer(NULL, chunk_size, 1 TSRMLS_CC);
php_ob_set_internal_handler(php_url_scanner_output_handler, chunk_size, "URL-Rewriter",
1 TSRMLS_CC);
BG(url_adapt_state_ex).active = 1;
}
Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.140 php4/ext/zlib/zlib.c:1.141
--- php4/ext/zlib/zlib.c:1.140 Sat Aug 10 08:58:46 2002
+++ php4/ext/zlib/zlib.c Sat Aug 10 12:12:36 2002
@@ -18,7 +18,7 @@
| Jade Nicoletti <nicoletti@nns.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.140 2002/08/10 12:58:46 helly Exp $ */
+/* $Id: zlib.c,v 1.141 2002/08/10 16:12:36 helly Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -1013,9 +1013,7 @@
return FAILURE;
}
- if (OG(ob_nesting_level)==0)
- php_start_ob_buffer(NULL, buffer_size, 0 TSRMLS_CC);
- php_ob_set_internal_handler(php_gzip_output_handler, (uint)(buffer_size*1.5f), "zlib output
compression", 0 TSRMLS_CC);
+ php_ob_set_internal_handler(php_gzip_output_handler, buffer_size*3/2, "zlib output
compression", 0 TSRMLS_CC);
if (ZLIBG(output_handler) && strlen(ZLIBG(output_handler))) {
php_start_ob_buffer_named(ZLIBG(output_handler), 0, 1 TSRMLS_CC);
}