Skip to content

Commit

Permalink
test(udp): fix recv_buf initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Sep 27, 2024
1 parent 92c48de commit a4d1ef2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neqo-udp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
);

sender.send(datagram)?;
let mut recv_buf = Vec::with_capacity(RECV_BUF_SIZE);
let mut recv_buf = vec![0; RECV_BUF_SIZE];
let res = receiver.recv(&receiver_addr, &mut recv_buf);
assert_eq!(res.unwrap_err().kind(), std::io::ErrorKind::WouldBlock);

Expand All @@ -184,7 +184,7 @@ mod tests {

sender.send(datagram)?;

let mut recv_buf = Vec::with_capacity(RECV_BUF_SIZE);
let mut recv_buf = vec![0; RECV_BUF_SIZE];
let received_datagram = receiver
.recv(&receiver_addr, &mut recv_buf)
.expect("receive to succeed");
Expand Down Expand Up @@ -227,7 +227,7 @@ mod tests {

// Allow for one GSO sendmmsg to result in multiple GRO recvmmsg.
let mut num_received = 0;
let mut recv_buf = Vec::with_capacity(RECV_BUF_SIZE);
let mut recv_buf = vec![0; RECV_BUF_SIZE];
while num_received < max_gso_segments {
recv_buf.clear();
let dgram = receiver
Expand Down

0 comments on commit a4d1ef2

Please sign in to comment.