mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Disabled reading from stream (calls to read()) after EOF
This commit is contained in:
parent
f05ed6390c
commit
f22ae56bc9
2
NEWS
2
NEWS
@ -9,6 +9,8 @@ PHP NEWS
|
||||
In case of modification of corresponding registry-tree PHP will reload
|
||||
it automatic
|
||||
. start timiout thread only if necessary
|
||||
- Streams optimization (Dmitry)
|
||||
. disabled calls to read() after EOF
|
||||
- VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR.
|
||||
(Dmitry)
|
||||
- ext/bcmath intialization code is moved from request startup to module
|
||||
|
@ -312,6 +312,9 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
|
||||
assert(data != NULL);
|
||||
|
||||
if (data->fd >= 0) {
|
||||
if (stream->eof && !data->is_pipe) {
|
||||
return 0;
|
||||
}
|
||||
ret = read(data->fd, buf, count);
|
||||
|
||||
stream->eof = (ret == 0 || (ret == (size_t)-1 && errno != EWOULDBLOCK));
|
||||
|
Loading…
Reference in New Issue
Block a user