mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
MFH: - Fixed bug #41815 (Concurrent read/write fails when EOF is reached)
This commit is contained in:
parent
ed10530eb5
commit
efe310579e
2
NEWS
2
NEWS
@ -18,6 +18,7 @@ PHP NEWS
|
||||
(Dmitry, Andrei Nigmatulin)
|
||||
- Changed mail() function to be always available. (Johannes)
|
||||
|
||||
- Added check for unknown options passed to configure. (Jani)
|
||||
- Added persistent connection status checker to pdo_pgsql.
|
||||
(Elvis Pranskevichus, Ilia)
|
||||
- Added support for ATTR_TIMEOUT inside pdo_pgsql driver. (Ilia)
|
||||
@ -74,6 +75,7 @@ PHP NEWS
|
||||
a node's siblings). (Rob)
|
||||
- Fixed bug #41845 (pgsql extension does not compile with PostgreSQL <7.4).
|
||||
(Ilia)
|
||||
- Fixed bug #41815 (Concurrent read/write fails when EOF is reached). (Sascha)
|
||||
- Fixed bug #41813 (segmentation fault when using string offset as an object).
|
||||
(judas dot iscariote at gmail dot com, Tony)
|
||||
- Fixed bug #41795 (checkdnsrr does not support DNS_TXT type).
|
||||
|
24
ext/standard/tests/file/bug41815.phpt
Normal file
24
ext/standard/tests/file/bug41815.phpt
Normal file
@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #41815 (Concurrent read/write fails when EOF is reached)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$filename = dirname(__FILE__)."/concur_rw.txt";
|
||||
|
||||
@unlink($filename);
|
||||
$writer = fopen($filename, "w");
|
||||
$reader = fopen($filename, "r");
|
||||
fread($reader, 1);
|
||||
fwrite($writer, "foo");
|
||||
|
||||
if (strlen(fread($reader, 10)) > 0) {
|
||||
echo "OK\n";
|
||||
}
|
||||
|
||||
@unlink($filename);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
OK
|
||||
Done
|
@ -329,9 +329,6 @@ 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);
|
||||
|
||||
if (ret == (size_t)-1 && errno == EINTR) {
|
||||
|
Loading…
Reference in New Issue
Block a user