mike Tue Oct 3 22:20:29 2006 UTC
Modified files:
/php-src/main output.c php_output.h
Log:
- fix failure with tests/lang/bug23489.phpt
- allocate fci param space at once with php_output_handler_user_func_t
http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.197&r2=1.198&diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.197 php-src/main/output.c:1.198
--- php-src/main/output.c:1.197 Tue Oct 3 08:15:44 2006
+++ php-src/main/output.c Tue Oct 3 22:20:28 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.197 2006/10/03 08:15:44 mike Exp $ */
+/* $Id: output.c,v 1.198 2006/10/03 22:20:28 mike Exp $ */
#ifndef PHP_OUTPUT_DEBUG
# define PHP_OUTPUT_DEBUG 0
@@ -509,8 +509,13 @@
MAKE_STD_ZVAL(handler_name);
zend_make_callable(output_handler, handler_name
TSRMLS_CC);
handler = php_output_handler_init(handler_name,
chunk_size, (flags & ~0xf) | PHP_OUTPUT_HANDLER_USER);
- handler->func.user = user;
zval_ptr_dtor(&handler_name);
+
+ ZVAL_ADDREF(output_handler);
+ user->zoh = output_handler;
+ user->fci.param_count = 2;
+ user->fci.params = (zval ***) &user->fcp;
+ handler->func.user = user;
} else {
efree(user);
}
@@ -710,6 +715,7 @@
zval_ptr_dtor(&handler->name);
STR_FREE(handler->buffer.data);
if (handler->flags & PHP_OUTPUT_HANDLER_USER) {
+ zval_ptr_dtor(&handler->func.user->zoh);
efree(handler->func.user);
}
if (handler->dtor && handler->opaq) {
@@ -944,8 +950,6 @@
ZVAL_STRINGL(params[0], handler->buffer.data,
handler->buffer.used, 1);
MAKE_STD_ZVAL(params[1]);
ZVAL_LONG(params[1], (long) context->op);
- handler->func.user->fci.param_count = 2;
- handler->func.user->fci.params = (zval***)
safe_emalloc(handler->func.user->fci.param_count, sizeof(zval**), 0);
handler->func.user->fci.params[0] = ¶ms[0];
handler->func.user->fci.params[1] = ¶ms[1];
@@ -966,7 +970,8 @@
/* call failed, pass internal buffer along */
status = PHP_OUTPUT_HANDLER_FAILURE;
}
- zend_fcall_info_args(&handler->func.user->fci, NULL
TSRMLS_CC);
+ zval_ptr_dtor(¶ms[0]);
+ zval_ptr_dtor(¶ms[1]);
if (retval) {
zval_ptr_dtor(&retval);
}
http://cvs.php.net/viewvc.cgi/php-src/main/php_output.h?r1=1.66&r2=1.67&diff_format=u
Index: php-src/main/php_output.h
diff -u php-src/main/php_output.h:1.66 php-src/main/php_output.h:1.67
--- php-src/main/php_output.h:1.66 Tue Oct 3 08:15:44 2006
+++ php-src/main/php_output.h Tue Oct 3 22:20:28 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_output.h,v 1.66 2006/10/03 08:15:44 mike Exp $ */
+/* $Id: php_output.h,v 1.67 2006/10/03 22:20:28 mike Exp $ */
#ifndef PHP_OUTPUT_H
#define PHP_OUTPUT_H
@@ -114,6 +114,8 @@
typedef struct _php_output_handler_user_func_t {
zend_fcall_info fci;
zend_fcall_info_cache fcc;
+ zval **fcp[2];
+ zval *zoh;
} php_output_handler_user_func_t;
typedef struct _php_output_handler {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php