You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, this eof()always returns false. While it is understandable due to the way it has been implemented, this is incorrect behaviour. read(...) for the same implementation is able to determine when the end-of-file has been reached, and therefore eof() should be able to as well.
Second, read_byte() of this implementation will fail if no data is read from the buffer. While somewhat understandable behaviour, this breaks the use of ReaderUtil::read_line(), which calls read_byte() repeatedly until it finds an end-of-line or end-of-file. Looking through other implementations of read_byte() in io.rs, it appears that the standard behaviour is to return -1 when end-of-file has been reached. I suggest that we should do the same here, and assume that we have reached the end of the file when no more bytes are read.
The text was updated successfully, but these errors were encountered:
Fix tokio test ICE
Fixesrust-lang#3858
It turned out that the issue mentioned [here](rust-lang/miri#3858 (comment)) is the exact cause of ICE.
So in this PR, I changed the type of ``EpollEventInterest::epfd`` from ``i32`` to ``WeakFileDescriptionRef``.
Firstly, this
eof()
always returnsfalse
. While it is understandable due to the way it has been implemented, this is incorrect behaviour.read(...)
for the same implementation is able to determine when the end-of-file has been reached, and thereforeeof()
should be able to as well.Second,
read_byte()
of this implementation willfail
if no data is read from the buffer. While somewhat understandable behaviour, this breaks the use ofReaderUtil::read_line()
, which callsread_byte()
repeatedly until it finds an end-of-line or end-of-file. Looking through other implementations ofread_byte()
inio.rs
, it appears that the standard behaviour is to return-1
when end-of-file has been reached. I suggest that we should do the same here, and assume that we have reached the end of the file when no more bytes are read.The text was updated successfully, but these errors were encountered: