-
Notifications
You must be signed in to change notification settings - Fork 113
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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?
tokio-boring/src/lib.rs
Outdated
// 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(())); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
In production with real-world websites. |
85c2e8a
to
439a549
Compare
boring/src/ssl/mod.rs
Outdated
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)); |
There was a problem hiding this comment.
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.
857b858
to
b46582e
Compare
No description provided.