diff --git a/Cargo.lock b/Cargo.lock index be8d91d9..5c4902e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1077,7 +1077,7 @@ dependencies = [ "pin-project", "proxy-protocol", "realm_hook 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "realm_io 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "realm_io 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "realm_lb 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "realm_syscall 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "tokio", @@ -1103,7 +1103,7 @@ dependencies = [ [[package]] name = "realm_io" -version = "0.5.0" +version = "0.5.1" dependencies = [ "libc", "socket2", @@ -1112,9 +1112,9 @@ dependencies = [ [[package]] name = "realm_io" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3bfdfae2ed43b8010fb5da2f29e7a6b2d5e511a0ae0352a5660aa5caa65288" +checksum = "2558ac548920bb63a08d21496481b24818501cb1a7bbd7c1c3b6d9bc5d1e4a41" dependencies = [ "libc", "socket2", diff --git a/realm_io/Cargo.toml b/realm_io/Cargo.toml index 1f276a31..e5bd2cf4 100644 --- a/realm_io/Cargo.toml +++ b/realm_io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "realm_io" -version = "0.5.0" +version = "0.5.1" authors = ["zephyr "] description = "Realm's high performance IO collections." repository = "https://github.com/zhboner/realm" diff --git a/realm_io/src/linux/mmsg.rs b/realm_io/src/linux/mmsg.rs index 42296fca..e7795bd1 100644 --- a/realm_io/src/linux/mmsg.rs +++ b/realm_io/src/linux/mmsg.rs @@ -183,8 +183,8 @@ mod store { } = self.store.msg_hdr; unsafe { MmsgRef { addr: &*msg_name.cast(), - iovec: make_slice(msg_iov as *const _, msg_iovlen), - control: make_slice(msg_control as *const _, msg_controllen), + iovec: make_slice(msg_iov as *const _, msg_iovlen as _), + control: make_slice(msg_control as *const _, msg_controllen as _), flags: &self.store.msg_hdr.msg_flags, nbytes: self.store.msg_len, _lifetime: PhantomData, @@ -202,21 +202,21 @@ mod store { /// Set target address. pub const fn with_addr(mut self, addr: &'a SockAddrStore) -> Self { self.store.msg_hdr.msg_name = addr.0.as_ptr() as *mut _; - self.store.msg_hdr.msg_namelen = addr.0.len(); + self.store.msg_hdr.msg_namelen = addr.0.len() as _; self } /// Set data to send. pub const fn with_iovec(mut self, iov: &'iov [IoSlice<'b>]) -> Self { self.store.msg_hdr.msg_iov = ptr::from_ref(iov) as *mut _; - self.store.msg_hdr.msg_iovlen = iov.len(); + self.store.msg_hdr.msg_iovlen = iov.len() as _; self } /// Set control message to send. pub const fn with_control(mut self, ctrl: &'ctrl [u8]) -> Self { self.store.msg_hdr.msg_control = ptr::from_ref(ctrl) as *mut _; - self.store.msg_hdr.msg_controllen = ctrl.len(); + self.store.msg_hdr.msg_controllen = ctrl.len() as _; self } @@ -231,21 +231,21 @@ mod store { /// Set storage to accommodate peer address. pub fn with_addr(mut self, addr: &'a mut SockAddrStore) -> Self { self.store.msg_hdr.msg_name = addr.0.as_ptr() as *mut _; - self.store.msg_hdr.msg_namelen = addr.0.len(); + self.store.msg_hdr.msg_namelen = addr.0.len() as _; self } /// Set storage to receive data. pub fn with_iovec(mut self, iov: &'iov mut [IoSliceMut<'b>]) -> Self { self.store.msg_hdr.msg_iov = ptr::from_mut(iov) as *mut _; - self.store.msg_hdr.msg_iovlen = iov.len(); + self.store.msg_hdr.msg_iovlen = iov.len() as _; self } /// Set storage to receive control message. pub fn with_control(mut self, ctrl: &'ctrl mut [u8]) -> Self { self.store.msg_hdr.msg_control = ptr::from_mut(ctrl) as *mut _; - self.store.msg_hdr.msg_controllen = ctrl.len(); + self.store.msg_hdr.msg_controllen = ctrl.len() as _; self } @@ -259,8 +259,8 @@ mod store { } = self.store.msg_hdr; unsafe { MmsgMutRef { addr: &mut *msg_name.cast(), - iovec: make_slice_mut(msg_iov as *mut _, msg_iovlen), - control: make_slice_mut(msg_control as *mut _, msg_controllen), + iovec: make_slice_mut(msg_iov as *mut _, msg_iovlen as _), + control: make_slice_mut(msg_control as *mut _, msg_controllen as _), flags: &mut self.store.msg_hdr.msg_flags, nbytes: self.store.msg_len, _lifetime: PhantomData,