Rust: fix incorrect use of lwip API.

This commit is contained in:
whitequark 2016-09-23 05:20:15 +00:00
parent ce05eee80c
commit 956f64906d
2 changed files with 1 additions and 2 deletions

View File

@ -375,7 +375,7 @@ impl TcpListener {
backlog: LinkedList::new()
}));
let arg = &mut *state as *mut RefCell<TcpListenerState> as *mut _;
lwip_sys::tcp_arg(raw, arg);
lwip_sys::tcp_arg(raw2, arg);
lwip_sys::tcp_accept(raw2, accept);
Ok(TcpListener { raw: raw2, state: state })
}

View File

@ -257,7 +257,6 @@ impl<'a> TcpListener<'a> {
pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
try!(self.waiter.tcp_acceptable(&self.lower));
loop {}
let stream_lower = self.lower.try_accept().unwrap();
let addr = SocketAddr::new(IP_ANY, 0); // FIXME: coax lwip into giving real addr here
Ok((TcpStream {