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

Don't return shutdown errors during shutdown #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nox
Copy link
Collaborator

@nox nox commented Jan 31, 2022

No description provided.

Copy link
Contributor

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

Is this something we can test somehow? When did you run into this error?

Comment on lines 257 to 264
// If boring returns PROTOCOL_IS_SHUTDOWN then the connection
// has already been shutdown and we can just return Ok(()), as
// this was exactly what we wanted to do anyway.
if e.code() == ErrorCode::SSL {
if let Some(stack) = e.ssl_error() {
if let Some(first) = stack.errors.first() {
if first.code() as i32 == boring_sys::SSL_R_PROTOCOL_IS_SHUTDOWN {
return Poll::Ready(Ok(()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, could we do this in boring::ssl::SslStream instead of tokio-boring? It seems like something that's generally useful, not just when using tokio.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

boring::ssl::SslStream felt more low-level to me, are you sure you want me to move it there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@nox
Copy link
Collaborator Author

nox commented Sep 30, 2022

When did you run into this error?

In production with real-world websites.

@nox nox force-pushed the shutdown branch 3 times, most recently from 85c2e8a to 439a549 Compare December 6, 2022 09:16
if let Some(stack) = e.ssl_error() {
if let Some(first) = stack.errors.first() {
if first.code() as i32 == boring_sys::SSL_R_PROTOCOL_IS_SHUTDOWN {
return Poll::Ready(Ok(ShutdownResult::Received));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not exactly sure what this means. This is why I didn't put it in the boring crate at first.

@nox nox force-pushed the shutdown branch 2 times, most recently from 857b858 to b46582e Compare December 6, 2022 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants