From 659da67ef21ea8ecea53e6c25b702e6b02f203bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 11:29:43 +0000 Subject: [PATCH 1/2] Update mio requirement from 0.6.17 to 0.8.10 Updates the requirements on [mio](https://github.com/tokio-rs/mio) to permit the latest version. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/compare/v0.6.17...v0.8.10) --- updated-dependencies: - dependency-name: mio dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- neqo-server/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neqo-server/Cargo.toml b/neqo-server/Cargo.toml index 09ac930d50..1b42c9dd11 100644 --- a/neqo-server/Cargo.toml +++ b/neqo-server/Cargo.toml @@ -14,7 +14,7 @@ neqo-http3 = { path = "./../neqo-http3" } neqo-qpack = { path = "./../neqo-qpack" } structopt = "0.3.7" regex = "1" -mio = "0.6.17" +mio = "0.8.10" mio-extras = "2.0.5" log = {version = "0.4.0", default-features = false} qlog = "0.11.0" From fd5ee2c3f70eb77e52a1d4adf70d5b585a035e58 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Wed, 3 Jan 2024 16:01:38 +0200 Subject: [PATCH 2/2] Fixes towards supporting mio-0.8.10 Note that mio-extras is not being updated for compatibility with mio-0.7.0 and beyond, so we will need to choose something else in order to move to newer mio versions. --- neqo-server/Cargo.toml | 6 +++--- neqo-server/src/main.rs | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/neqo-server/Cargo.toml b/neqo-server/Cargo.toml index 1b42c9dd11..9231f7c8db 100644 --- a/neqo-server/Cargo.toml +++ b/neqo-server/Cargo.toml @@ -9,14 +9,14 @@ license = "MIT OR Apache-2.0" [dependencies] neqo-crypto = { path = "./../neqo-crypto" } neqo-transport = { path = "./../neqo-transport" } -neqo-common = { path="./../neqo-common" } +neqo-common = { path = "./../neqo-common" } neqo-http3 = { path = "./../neqo-http3" } neqo-qpack = { path = "./../neqo-qpack" } structopt = "0.3.7" regex = "1" -mio = "0.8.10" +mio = { version = "0.8.10", features = ["net", "os-poll"] } mio-extras = "2.0.5" -log = {version = "0.4.0", default-features = false} +log = { version = "0.4.0", default-features = false } qlog = "0.11.0" [features] diff --git a/neqo-server/src/main.rs b/neqo-server/src/main.rs index ac4c952837..985a14e79b 100644 --- a/neqo-server/src/main.rs +++ b/neqo-server/src/main.rs @@ -25,7 +25,7 @@ use std::{ time::{Duration, Instant}, }; -use mio::{net::UdpSocket, Events, Poll, PollOpt, Ready, Token}; +use mio::{net::UdpSocket, Events, Interest, Poll, Token}; use mio_extras::timer::{Builder, Timeout, Timer}; use neqo_transport::ConnectionIdGenerator; use structopt::StructOpt; @@ -319,7 +319,7 @@ impl QuicParameters { fn emit_packet(socket: &mut UdpSocket, out_dgram: Datagram) { let sent = socket - .send_to(&out_dgram, &out_dgram.destination()) + .send_to(&out_dgram, out_dgram.destination()) .expect("Error sending datagram"); if sent != out_dgram.len() { eprintln!("Unable to send all {} bytes of datagram", out_dgram.len()); @@ -650,7 +650,7 @@ impl ServersRunner { } for (i, host) in self.hosts.iter().enumerate() { - let socket = match UdpSocket::bind(host) { + let socket = match UdpSocket::bind(*host) { Err(err) => { eprintln!("Unable to bind UDP socket: {err}"); return Err(err); @@ -673,18 +673,18 @@ impl ServersRunner { }; println!("Server waiting for connection on: {local_addr:?}{also_v4}"); - self.poll.register( - &socket, + self.poll.registry().register( + &mut socket, Token(i), - Ready::readable() | Ready::writable(), - PollOpt::edge(), + Interest::READABLE | Interest::WRITABLE, )?; self.sockets.push(socket); } self.poll - .register(&self.timer, TIMER_TOKEN, Ready::readable(), PollOpt::edge())?; + .registry() + .register(&mut self.timer, TIMER_TOKEN, Interest::READABLE)?; Ok(()) } @@ -816,7 +816,7 @@ impl ServersRunner { if event.token() == TIMER_TOKEN { self.process_timeout()?; } else { - if !event.readiness().is_readable() { + if !event.is_readable() { continue; } self.process_datagrams_and_events(event.token().0, true)?;