From 6925205fc80d012bd5c4d475bbc9bce0a9994637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aurimas=20Bla=C5=BEulionis?= <0x60@pm.me> Date: Fri, 3 Nov 2023 20:41:06 +0000 Subject: [PATCH] Box up io_uring recv_msg --- mfio-rt/src/native/impls/io_uring/tcp_stream.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mfio-rt/src/native/impls/io_uring/tcp_stream.rs b/mfio-rt/src/native/impls/io_uring/tcp_stream.rs index a093441..20bf15c 100644 --- a/mfio-rt/src/native/impls/io_uring/tcp_stream.rs +++ b/mfio-rt/src/native/impls/io_uring/tcp_stream.rs @@ -39,7 +39,7 @@ pub struct StreamInner { stream: StreamBuf, in_read: bool, in_write: usize, - recv_msg: msghdr, + recv_msg: Box, read_queue: Vec>, write_queue: Vec>, } @@ -64,7 +64,7 @@ impl From for StreamInner { stream: StreamBuf::default(), in_read: false, in_write: 0, - recv_msg: empty_msg(), + recv_msg: empty_msg().into(), read_queue: Default::default(), write_queue: Default::default(), } @@ -110,7 +110,7 @@ impl StreamInner { let queue = self.stream.read_queue(); if !queue.is_empty() { self.in_read = true; - let msg = &mut self.recv_msg; + let msg = &mut *self.recv_msg; // Limit iov read to IOV_MAX, because we don't want to have the operation fail. msg.msg_iovlen = core::cmp::min(queue.len() as usize, *IOV_MAX as usize) as _; msg.msg_iov = queue.as_mut_ptr() as *mut iovec;