Skip to content

Commit

Permalink
Merge pull request #34 from vertexclique/bring-back-send-on-accept
Browse files Browse the repository at this point in the history
Bring back 'Send' on io_uring
  • Loading branch information
vertexclique authored Jan 23, 2024
2 parents 9e8f913 + 797a330 commit 84d5c6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/syscore/linux/iouring/nethandle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl Handle<TcpListener> {

pub fn incoming(
&self,
) -> impl Stream<Item = io::Result<Handle<TcpStream>>> + Unpin + '_ {
) -> impl Stream<Item = io::Result<Handle<TcpStream>>> + Send + Unpin + '_ {
Box::pin(futures::stream::unfold(
self,
|listener: &Handle<TcpListener>| async move {
Expand Down
8 changes: 1 addition & 7 deletions src/syscore/linux/iouring/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,7 @@ impl Processor {
) -> io::Result<(Handle<TcpStream>, Option<SocketAddr>)> {
let fd = listener.as_raw_fd() as _;

let (mut storage, mut addrlen) = unsafe {
let mut addrlen = mem::size_of::<sockaddr>() as socklen_t;
let mut storage = MaybeUninit::<sockaddr>::zeroed().assume_init();
(storage, addrlen)
};

let mut sqe = OP::Accept::new(Fd(fd), &mut storage as *mut _ as *mut _, &mut addrlen as *mut _ as *mut _)
let mut sqe = OP::Accept::new(Fd(fd), null_mut(), null_mut())
.flags(SocketFlags::NONBLOCK)
.build();

Expand Down

0 comments on commit 84d5c6b

Please sign in to comment.