1
Fork 0

native: Remove a bogus assert in net::read

This assert was likely inherited from some point, but it's not quite valid as a
no-timeout read may enter this loop, but data could be stolen by any other read
after the socket is deemed readable.

I saw this fail in a recent bors run where the assertion was tripped.
This commit is contained in:
Alex Crichton 2014-09-02 08:21:51 -07:00
parent 5dfb7a6ec1
commit 2ec7bb8756

View file

@ -959,7 +959,7 @@ pub fn read<T>(fd: sock_t,
// wait for the socket to become readable again.
let _guard = lock();
match retry(|| read(deadline.is_some())) {
-1 if util::wouldblock() => { assert!(deadline.is_some()); }
-1 if util::wouldblock() => {}
-1 => return Err(os::last_error()),
n => { ret = n; break }
}