Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused waker #243

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions h3/src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
use std::{
marker::PhantomData,
sync::{atomic::AtomicUsize, Arc},
task::Poll,
};

use bytes::{Buf, Bytes};
use futures_util::future;

use crate::{
config::Config,
Expand Down Expand Up @@ -107,8 +105,6 @@ impl Builder {
let open = quic.opener();
let conn_state = SharedStateRef::default();

let conn_waker = Some(future::poll_fn(|cx| Poll::Ready(cx.waker().clone())).await);

Ok((
Connection {
inner: ConnectionInner::new(quic, conn_state.clone(), self.config).await?,
Expand All @@ -118,7 +114,6 @@ impl Builder {
SendRequest {
open,
conn_state,
conn_waker,
max_field_section_size: self.config.settings.max_field_section_size,
sender_count: Arc::new(AtomicUsize::new(1)),
send_grease_frame: self.config.send_grease,
Expand Down
7 changes: 1 addition & 6 deletions h3/src/client/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::{
marker::PhantomData,
sync::{atomic::AtomicUsize, Arc},
task::{Context, Poll, Waker},
task::{Context, Poll},
};

use bytes::{Buf, BytesMut};
Expand Down Expand Up @@ -110,7 +110,6 @@ where
pub(super) max_field_section_size: u64, // maximum size for a header we receive
// counts instances of SendRequest to close the connection when the last is dropped.
pub(super) sender_count: Arc<AtomicUsize>,
pub(super) conn_waker: Option<Waker>,
pub(super) _buf: PhantomData<fn(B)>,
pub(super) send_grease_frame: bool,
}
Expand Down Expand Up @@ -217,7 +216,6 @@ where
conn_state: self.conn_state.clone(),
max_field_section_size: self.max_field_section_size,
sender_count: self.sender_count.clone(),
conn_waker: self.conn_waker.clone(),
_buf: PhantomData,
send_grease_frame: self.send_grease_frame,
}
Expand All @@ -235,9 +233,6 @@ where
.fetch_sub(1, std::sync::atomic::Ordering::AcqRel)
== 1
{
if let Some(w) = Option::take(&mut self.conn_waker) {
w.wake()
}
self.shared_state().write("SendRequest drop").error = Some(Error::closed());
self.open.close(Code::H3_NO_ERROR, b"");
}
Expand Down
Loading