]> git.lizzy.rs Git - rust.git/commitdiff
native: Remove a bogus assert in net::read
authorAlex Crichton <alex@alexcrichton.com>
Tue, 2 Sep 2014 15:21:51 +0000 (08:21 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 2 Sep 2014 15:21:51 +0000 (08:21 -0700)
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.

src/libnative/io/net.rs

index 368b5914444ac9509f12fca2e28f23258b674cca..55687c964395eca0313a30cae6baf1cd5837b95a 100644 (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 }
             }