mirror of https://github.com/m-labs/artiq.git
Rust: fix incorrect use of lwip API.
This commit is contained in:
parent
ce05eee80c
commit
956f64906d
|
@ -375,7 +375,7 @@ impl TcpListener {
|
||||||
backlog: LinkedList::new()
|
backlog: LinkedList::new()
|
||||||
}));
|
}));
|
||||||
let arg = &mut *state as *mut RefCell<TcpListenerState> as *mut _;
|
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);
|
lwip_sys::tcp_accept(raw2, accept);
|
||||||
Ok(TcpListener { raw: raw2, state: state })
|
Ok(TcpListener { raw: raw2, state: state })
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,6 @@ impl<'a> TcpListener<'a> {
|
||||||
|
|
||||||
pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
|
pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
|
||||||
try!(self.waiter.tcp_acceptable(&self.lower));
|
try!(self.waiter.tcp_acceptable(&self.lower));
|
||||||
loop {}
|
|
||||||
let stream_lower = self.lower.try_accept().unwrap();
|
let stream_lower = self.lower.try_accept().unwrap();
|
||||||
let addr = SocketAddr::new(IP_ANY, 0); // FIXME: coax lwip into giving real addr here
|
let addr = SocketAddr::new(IP_ANY, 0); // FIXME: coax lwip into giving real addr here
|
||||||
Ok((TcpStream {
|
Ok((TcpStream {
|
||||||
|
|
Loading…
Reference in New Issue