From 97b329c164cb1e0f61eb2cefd910d61d9004895e Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 7 Feb 2013 16:12:23 +0100 Subject: [PATCH] Added a length parameter to read --- php_uv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/php_uv.c b/php_uv.c index 22318a2..3dbf0e0 100644 --- a/php_uv.c +++ b/php_uv.c @@ -915,12 +915,13 @@ static void php_uv_fs_common(uv_fs_type fs_type, INTERNAL_FUNCTION_PARAMETERS) { zval *zstream = NULL; unsigned long fd; + unsigned long length; - PHP_UV_FS_PARSE_PARAMETERS("zzf", &zloop, &zstream, &fci, &fcc); - memset(uv_fs_read_buf, 0, sizeof(uv_fs_read_buf)); + PHP_UV_FS_PARSE_PARAMETERS("zzlf", &zloop, &zstream, &length, &fci, &fcc); + memset(uv_fs_read_buf, 0, length); PHP_UV_FS_SETUP() PHP_UV_ZVAL_TO_FD(fd, zstream); - PHP_UV_FS_ASYNC(loop, read, fd, uv_fs_read_buf, sizeof(uv_fs_read_buf), -1); + PHP_UV_FS_ASYNC(loop, read, fd, uv_fs_read_buf, length, -1); break; } case UV_FS_SENDFILE: