Avoid unused variables in the network module

This commit is contained in:
Ruihan Li
2024-06-18 16:05:20 +08:00
committed by Tate, Hongliang Tian
parent 94e043ac8d
commit 5eefd600cc
18 changed files with 34 additions and 79 deletions

View File

@ -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();

View File

@ -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 {