Skip to content

Commit

Permalink
auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Sep 7, 2014
2 parents 19dc574 + 2ec7bb8 commit aaf141d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libnative/io/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down

0 comments on commit aaf141d

Please sign in to comment.