From 2ec7bb8756a449ce4c99c0ac829be9c79c1c3992 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 2 Sep 2014 08:21:51 -0700 Subject: [PATCH] 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. --- src/libnative/io/net.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } } -- 2.44.0