Fix bug #51056: fread() on blocking stream will block even if data is available

This is applied only on socket connection which already returns
immediately if there is no data in the buffer.
This commit is contained in:
Jakub Zelenka 2022-10-05 14:31:28 +01:00
parent 1c1481bbb5
commit 18fe337bae
No known key found for this signature in database
GPG key ID: 1C0779DC5C0A9DE4
6 changed files with 94 additions and 19 deletions

View file

@ -225,6 +225,7 @@ struct _php_stream {
size_t readbuflen;
zend_off_t readpos;
zend_off_t writepos;
ssize_t didread;
/* how much data to read when filling buffer */
size_t chunk_size;