From: Alex Crichton Date: Tue, 2 Sep 2014 15:21:51 +0000 (-0700) Subject: native: Remove a bogus assert in net::read X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=2ec7bb8756a449ce4c99c0ac829be9c79c1c3992;p=rust.git 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. --- diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index 368b5914444..55687c96439 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -959,7 +959,7 @@ pub fn read(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 } }