This PR addresses an issue related to EOF detection in tcpstream.
According to the AsyncRead::poll_read documentation, buf.filled().len() remains unchanged when EOF is reached. However, in scenarios where the read_rx contains a sequence like {["blabla"], []}, the poll_read method returns Poll::Ready(Ok(())) with a changed buf.filled().len(). This leads to the subsequent poll_read call getting stuck in poll_recv until a stream error occurs.
The proposed changes improve the EOF detection mechanism to prevent this unintended behavior and ensure proper stream termination.
This PR addresses an issue related to EOF detection in tcpstream. According to the AsyncRead::poll_read documentation,
buf.filled().len()
remains unchanged when EOF is reached. However, in scenarios where theread_rx
contains a sequence like{["blabla"], []}
, thepoll_read
method returnsPoll::Ready(Ok(()))
with a changedbuf.filled().len()
. This leads to the subsequentpoll_read
call getting stuck inpoll_recv
until a stream error occurs. The proposed changes improve the EOF detection mechanism to prevent this unintended behavior and ensure proper stream termination.