Skip to content

avoid set_waker in s2n-tls-tokio #3889

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Mar 16, 2023

Simpler than #3748 but has the same performance benefits.


self.as_mut().set_receive_callback(Some(Self::recv_io_cb))?;
self.as_mut().set_send_callback(Some(Self::send_io_cb))?;
self.as_mut().set_receive_context(context)?;
self.as_mut().set_send_context(context)?;
self.as_mut().set_waker(Some(ctx.waker()))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change won't work with the async callbacks, who all expect there to be a waker set on the connection to work properly. Instead of changing the context, it should be possible to implement a stack Waker that holds a pinned pointer to the async context on the stack.

If this isn't possible, we need to change all of the functions to require &mut core::task::Context be passed into them. And this wouldn't be the worst thing; it would definitely make it more rust-like. It just breaks the signature.

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants