Skip to content

Commit

Permalink
feat(bin): use quinn-udp crates.io release instead of git ref
Browse files Browse the repository at this point in the history
`neqo-bin` has been importing `quinn-udp` as a git reference, in order to
include quinn-rs/quinn#1765. The quinn project has since
released `quinn-udp` `v0.5.0`.

This commit upgrades `neqo-bin` to use `quinn-udp` `v0.5.0`.

`quinn-udp` has dropped `sendmmsg` support in the `v0.5.0`
release (quinn-rs/quinn@ee08826).
`neqo-bin` does not (yet) use `sendmmsg`. This might change in the
future (mozilla#1693).
  • Loading branch information
mxinden committed May 13, 2024
1 parent 3015218 commit a4d1083
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion neqo-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ neqo-http3 = { path = "./../neqo-http3" }
neqo-qpack = { path = "./../neqo-qpack" }
neqo-transport = { path = "./../neqo-transport" }
qlog = { workspace = true }
quinn-udp = { git = "https://github.com/quinn-rs/quinn/", rev = "a947962131aba8a6521253d03cc948b20098a2d6" }
quinn-udp = { version = "0.5.0", default-features = false }
regex = { version = "1.9", default-features = false, features = ["unicode-perl"] }
tokio = { version = "1", default-features = false, features = ["net", "time", "macros", "rt", "rt-multi-thread"] }
url = { version = "2.5", default-features = false }
Expand Down
18 changes: 6 additions & 12 deletions neqo-bin/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@ impl Socket {
let transmit = Transmit {
destination: d.destination(),
ecn: EcnCodepoint::from_bits(Into::<u8>::into(d.tos())),
contents: Vec::from(d).into(),
contents: &d,
segment_size: None,
src_ip: None,
};

let n = self.socket.try_io(Interest::WRITABLE, || {
self.state
.send((&self.socket).into(), slice::from_ref(&transmit))
self.socket.try_io(Interest::WRITABLE, || {
self.state.send((&self.socket).into(), &transmit)
})?;

assert_eq!(n, 1, "only passed one slice");

Ok(())
}

Expand Down Expand Up @@ -189,17 +186,14 @@ mod tests {
IpTosDscp::Le,
IpTosEcn::Ect1,
)))),
contents: msg.clone().into(),
contents: &msg,
segment_size: Some(SEGMENT_SIZE),
src_ip: None,
};
sender.writable().await?;
let n = sender.socket.try_io(Interest::WRITABLE, || {
sender
.state
.send((&sender.socket).into(), slice::from_ref(&transmit))
sender.socket.try_io(Interest::WRITABLE, || {
sender.state.send((&sender.socket).into(), &transmit)
})?;
assert_eq!(n, 1, "only passed one slice");

// Allow for one GSO sendmmsg to result in multiple GRO recvmmsg.
let mut num_received = 0;
Expand Down

0 comments on commit a4d1083

Please sign in to comment.