Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/std/os/linux/IoUring.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3524,12 +3524,7 @@ test "accept/connect/send_zc/recv" {
_ = try ring.recv(0xffffffff, socket_test_harness.server, .{ .buffer = buffer_recv[0..] }, 0);
try testing.expectEqual(@as(u32, 2), try ring.submit());

var cqe_send, const cqe_recv = brk: {
const cqe1 = try ring.copy_cqe();
const cqe2 = try ring.copy_cqe();
break :brk if (cqe1.user_data == 0xeeeeeeee) .{ cqe1, cqe2 } else .{ cqe2, cqe1 };
};

var cqe_send = try ring.copy_cqe();
// First completion of zero-copy send.
// IORING_CQE_F_MORE, means that there
// will be a second completion event / notification for the
Expand All @@ -3541,6 +3536,12 @@ test "accept/connect/send_zc/recv" {
.flags = linux.IORING_CQE_F_MORE,
}, cqe_send);

cqe_send, const cqe_recv = brk: {
const cqe1 = try ring.copy_cqe();
const cqe2 = try ring.copy_cqe();
break :brk if (cqe1.user_data == 0xeeeeeeee) .{ cqe1, cqe2 } else .{ cqe2, cqe1 };
};

try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0xffffffff,
.res = buffer_recv.len,
Expand All @@ -3550,7 +3551,6 @@ test "accept/connect/send_zc/recv" {

// Second completion of zero-copy send.
// IORING_CQE_F_NOTIF in flags signals that kernel is done with send_buffer
cqe_send = try ring.copy_cqe();
try testing.expectEqual(linux.io_uring_cqe{
.user_data = 0xeeeeeeee,
.res = 0,
Expand Down