summaryrefslogtreecommitdiff
path: root/ext/phar
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-17 11:49:10 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-17 11:49:10 +0200
commit856c5d2837eac45567a4c83b22a5281f5d963d5c (patch)
tree3716ffdce0bfa184f435c5664a118f8419171829 /ext/phar
parent5a90dc77b8f244f603082aea022fadc0ce2c009c (diff)
downloadphp-git-856c5d2837eac45567a4c83b22a5281f5d963d5c.tar.gz
Revert "Avoid unused fstat() call"
This reverts commit 5a90dc77b8f244f603082aea022fadc0ce2c009c. Let's try to go with the reverse direction here and actually trust the reported size...
Diffstat (limited to 'ext/phar')
-rw-r--r--ext/phar/phar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 27ea2ff679..db81b14d8e 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -3221,6 +3221,11 @@ 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
@@ -3277,6 +3282,7 @@ 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) :