mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-29 04:13:24 +00:00
Avoid unused variables in the network module
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
94e043ac8d
commit
5eefd600cc
@ -92,7 +92,7 @@ impl Connected {
|
||||
connection.is_local_shutdown()
|
||||
}
|
||||
|
||||
pub fn shutdown(&self, cmd: SockShutdownCmd) -> Result<()> {
|
||||
pub fn shutdown(&self, _cmd: SockShutdownCmd) -> Result<()> {
|
||||
// TODO: deal with cmd
|
||||
if self.should_close() {
|
||||
let mut connection = self.connection.lock_irq_disabled();
|
||||
|
@ -124,7 +124,7 @@ impl VsockStreamSocket {
|
||||
}
|
||||
}
|
||||
|
||||
fn try_recv(&self, buf: &mut [u8], flags: SendRecvFlags) -> Result<(usize, SocketAddr)> {
|
||||
fn try_recv(&self, buf: &mut [u8], _flags: SendRecvFlags) -> Result<(usize, SocketAddr)> {
|
||||
let connected = match &*self.status.read() {
|
||||
Status::Connected(connected) => connected.clone(),
|
||||
Status::Init(_) | Status::Listen(_) => {
|
||||
@ -162,14 +162,12 @@ impl FileLike for VsockStreamSocket {
|
||||
|
||||
fn read(&self, buf: &mut [u8]) -> Result<usize> {
|
||||
// TODO: Set correct flags
|
||||
let flags = SendRecvFlags::empty();
|
||||
self.recv(buf, SendRecvFlags::empty()).map(|(len, _)| len)
|
||||
}
|
||||
|
||||
fn write(&self, buf: &[u8]) -> Result<usize> {
|
||||
// TODO: Set correct flags
|
||||
let flags = SendRecvFlags::empty();
|
||||
self.send(buf, flags)
|
||||
self.send(buf, SendRecvFlags::empty())
|
||||
}
|
||||
|
||||
fn poll(&self, mask: IoEvents, poller: Option<&Poller>) -> IoEvents {
|
||||
|
Reference in New Issue
Block a user