]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson
authorbors <bors@rust-lang.org>
Sun, 7 Sep 2014 23:01:34 +0000 (23:01 +0000)
committerbors <bors@rust-lang.org>
Sun, 7 Sep 2014 23:01:34 +0000 (23:01 +0000)
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 cbfc673e6af83da7f972867bc0c47a34285eca98..1a7a8da391a4a3a01a39be5e1e3f0b1ba7f6f054 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 }
             }