svn: /pecl/http/branches/DEV_2/ php_http_message_body.c

From: Date: Sat, 14 Jan 2012 13:59:56 +0000
Subject: svn: /pecl/http/branches/DEV_2/ php_http_message_body.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-17459@lists.php.net to get a copy of this message
mike Sat, 14 Jan 2012 13:59:56 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=322292 Log: fix http\message\Body::toCallback Changed paths: U pecl/http/branches/DEV_2/php_http_message_body.c Modified: pecl/http/branches/DEV_2/php_http_message_body.c =================================================================== --- pecl/http/branches/DEV_2/php_http_message_body.c 2012-01-14 13:55:27 UTC (rev 322291) +++ pecl/http/branches/DEV_2/php_http_message_body.c 2012-01-14 13:59:56 UTC (rev 322292) @@ -554,8 +554,8 @@ struct fcd { zval *fcz; - zend_fcall_info *fci; - zend_fcall_info_cache *fcc; + zend_fcall_info fci; + zend_fcall_info_cache fcc; #ifdef ZTS void ***ts; #endif @@ -569,9 +569,9 @@ MAKE_STD_ZVAL(zdata); ZVAL_STRINGL(zdata, str, len, 1); - if (SUCCESS == zend_fcall_info_argn(fcd->fci TSRMLS_CC, 2, fcd->fcz, zdata)) { - zend_fcall_info_call(fcd->fci, fcd->fcc, NULL, NULL TSRMLS_CC); - zend_fcall_info_args_clear(fcd->fci, 0); + if (SUCCESS == zend_fcall_info_argn(&fcd->fci TSRMLS_CC, 2, &fcd->fcz, &zdata)) { + zend_fcall_info_call(&fcd->fci, &fcd->fcc, NULL, NULL TSRMLS_CC); + zend_fcall_info_args_clear(&fcd->fci, 0); } zval_ptr_dtor(&zdata); return len; @@ -579,14 +579,19 @@ PHP_METHOD(HttpMessageBody, toCallback) { - struct fcd fcd; + struct fcd fcd = {0}; long offset = 0, forlen = 0; if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f|ll", &fcd.fci, &fcd.fcc, &offset, &forlen)) { php_http_message_body_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC); + fcd.fcz = getThis(); Z_ADDREF_P(fcd.fcz); + TSRMLS_SET_CTX(fcd.ts); + php_http_message_body_to_callback(obj->body, pass, &fcd, offset, forlen); + zend_fcall_info_args_clear(&fcd.fci, 1); + zval_ptr_dtor(&fcd.fcz); RETURN_TRUE; }

« previous php.pecl.cvs (#17459) next »