auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson

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:
bors 2014-09-07 23:01:34 +00:00
commit aaf141d399

View File

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