diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-17 11:01:57 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-17 11:22:31 +0200 |
commit | 5a90dc77b8f244f603082aea022fadc0ce2c009c (patch) | |
tree | a5682b1836a838aa9592cc831142b13042b752ec /ext/phar | |
parent | 6fbab09ef042df66153e4feaae8e07091d3d173e (diff) | |
download | php-git-5a90dc77b8f244f603082aea022fadc0ce2c009c.tar.gz |
Avoid unused fstat() call
If we're including a file via PHP streams, we're not going to trust
the reported file size anyway and populate in a loop -- so don't
bother determining the file size in the first place. Only do this
for non-tty HANDLE_FP now, which is the only case where this
information was used.
Diffstat (limited to 'ext/phar')
-rw-r--r-- | ext/phar/phar.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c index db81b14d8e..27ea2ff679 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3221,11 +3221,6 @@ static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len) /* {{ } /* }}} */ -static size_t phar_zend_stream_fsizer(void *handle) /* {{{ */ -{ - return ((phar_archive_data*)handle)->halt_offset + 32; -} /* }}} */ - zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type); #define phar_orig_zend_open zend_stream_open_function @@ -3282,7 +3277,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) file_handle->handle.stream.handle = phar; file_handle->handle.stream.reader = phar_zend_stream_reader; file_handle->handle.stream.closer = NULL; - file_handle->handle.stream.fsizer = phar_zend_stream_fsizer; file_handle->handle.stream.isatty = 0; phar->is_persistent ? php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) : |