diff --git a/HISTORY b/HISTORY index f6037c1..7d4a4aa 100644 --- a/HISTORY +++ b/HISTORY @@ -1,9 +1,10 @@ -Version 5.02 2014-07-04 +Version 5.02 2014-07-18 * corect README spell mistake * bug fixed: can't deal sync truncate file exception * remove tracker_global.c extern keyword to tracker_global.h * change log level from ERROR to DEBUG when IOEVENT_ERROR + * php callback should use INIT_ZVAL to init zval variable Version 5.01 2014-02-02 * trunk binlog be compressed when trunk init diff --git a/php_client/fastdfs_client.c b/php_client/fastdfs_client.c index d884614..e2b35b6 100644 --- a/php_client/fastdfs_client.c +++ b/php_client/fastdfs_client.c @@ -2858,12 +2858,16 @@ static int php_fdfs_upload_callback(void *arg, const int64_t file_size, int sock int result; TSRMLS_FETCH(); + INIT_ZVAL(ret); ZVAL_NULL(&ret); + + INIT_ZVAL(zsock); ZVAL_LONG(&zsock, sock); pUploadCallback = (php_fdfs_upload_callback_t *)arg; if (pUploadCallback->callback.args == NULL) { + INIT_ZVAL(null_args); ZVAL_NULL(&null_args); pUploadCallback->callback.args = &null_args; } @@ -2907,13 +2911,19 @@ static int php_fdfs_download_callback(void *arg, const int64_t file_size, \ int result; TSRMLS_FETCH(); + INIT_ZVAL(ret); ZVAL_NULL(&ret); + + INIT_ZVAL(zfilesize); ZVAL_LONG(&zfilesize, file_size); + + INIT_ZVAL(zdata); ZVAL_STRINGL(&zdata, (char *)data, current_size, 0); pCallback = (php_fdfs_callback_t *)arg; if (pCallback->args == NULL) { + INIT_ZVAL(null_args); ZVAL_NULL(&null_args); pCallback->args = &null_args; }