Skip to content

Commit

Permalink
Fixed some compile issues from the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt committed Jun 4, 2022
1 parent 8353c1b commit 3808667
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/wasi/src/state/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ impl InodeSocket
}
}

pub fn set_ttl(&mut self, ttl: u8) -> Result<(), __wasi_errno_t> {
pub fn set_ttl(&mut self, ttl: u32) -> Result<(), __wasi_errno_t> {
match &mut self.kind {
InodeSocketKind::TcpStream(sock) => {
sock.set_ttl(ttl).map_err(net_error_into_wasi_err)
Expand All @@ -603,7 +603,7 @@ impl InodeSocket
}
}

pub fn ttl(&self) -> Result<u8, __wasi_errno_t> {
pub fn ttl(&self) -> Result<u32, __wasi_errno_t> {
match &self.kind {
InodeSocketKind::TcpStream(sock) => {
sock.ttl().map_err(net_error_into_wasi_err)
Expand All @@ -617,7 +617,7 @@ impl InodeSocket
}
}

pub fn set_multicast_ttl_v4(&mut self, ttl: u8) -> Result<(), __wasi_errno_t> {
pub fn set_multicast_ttl_v4(&mut self, ttl: u32) -> Result<(), __wasi_errno_t> {
match &mut self.kind {
InodeSocketKind::UdpSocket(sock) => {
sock.set_multicast_ttl_v4(ttl).map_err(net_error_into_wasi_err)
Expand All @@ -628,7 +628,7 @@ impl InodeSocket
}
}

pub fn multicast_ttl_v4(&self) -> Result<u8, __wasi_errno_t> {
pub fn multicast_ttl_v4(&self) -> Result<u32, __wasi_errno_t> {
match &self.kind {
InodeSocketKind::UdpSocket(sock) => {
sock.multicast_ttl_v4().map_err(net_error_into_wasi_err)
Expand Down Expand Up @@ -762,7 +762,7 @@ impl InodeSocket
let reader = buf.as_ref();
let read = read_bytes(reader, memory, iov)
.map(|_| buf_len)?;
if let Some(InodeSocketKind::TcpStream(..)) = &self.kind {
if let InodeSocketKind::TcpStream(..) = &self.kind {
buf.advance(read);
} else {
buf.clear();
Expand Down
4 changes: 2 additions & 2 deletions lib/wasi/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4642,10 +4642,10 @@ pub fn sock_set_opt_size(
socket.set_send_buf_size(size as usize)
},
__WASI_SOCK_OPTION_TTL => {
socket.set_ttl(size as u8)
socket.set_ttl(size as u32)
},
__WASI_SOCK_OPTION_MULTICAST_TTL_V4 => {
socket.set_multicast_ttl_v4(size as u8)
socket.set_multicast_ttl_v4(size as u32)
},
_ => Err(__WASI_EINVAL)
}
Expand Down

0 comments on commit 3808667

Please sign in to comment.