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.
This commit is contained in:
Nikita Popov 2019-07-17 11:01:57 +02:00
parent 6fbab09ef0
commit 5a90dc77b8
4 changed files with 19 additions and 65 deletions

View file

@ -28,7 +28,6 @@
/* Lightweight stream implementation for the ZE scanners.
* These functions are private to the engine.
* */
typedef size_t (*zend_stream_fsizer_t)(void* handle);
typedef size_t (*zend_stream_reader_t)(void* handle, char *buf, size_t len);
typedef void (*zend_stream_closer_t)(void* handle);
@ -44,7 +43,6 @@ typedef struct _zend_stream {
void *handle;
int isatty;
zend_stream_reader_t reader;
zend_stream_fsizer_t fsizer;
zend_stream_closer_t closer;
} zend_stream;