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

Use Base.IOError in closewrite #260

Merged
merged 5 commits into from
Oct 21, 2022

Conversation

gustafsson
Copy link
Contributor

Instead of MbedException, in line with #257

Fixes #259

Instead of MbedException, in line with JuliaLang#257

Fixes JuliaLang#259
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Merging #260 (6633354) into master (ecf7e5b) will decrease coverage by 0.20%.
The diff coverage is 14.28%.

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
- Coverage   73.77%   73.56%   -0.21%     
==========================================
  Files          12       12              
  Lines         713      715       +2     
==========================================
  Hits          526      526              
- Misses        187      189       +2     
Impacted Files Coverage Δ
src/error.jl 33.33% <0.00%> (-2.39%) ⬇️
src/ssl.jl 72.37% <16.66%> (-0.26%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gustafsson
Copy link
Contributor Author

I stumbled upon a related question when making this change:
https://github.com/JuliaLang/MbedTLS.jl/pull/257/files#r997901371

@@ -202,7 +202,7 @@ function closewrite(ctx::SSLContext)
"never returns ...WANT_READ/WRITE."
elseif n != 0
ssl_abandon(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, as I commented on in the related PR, the problem here is ssl_abandon is going to throw before we're able to throw the IOError on the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks that make sense. However ssl_abandon doesn't throw in my scenario (#259) where I reliably end up here with n = -80, strerror(n) = NET - Connection was reset by peer.

So the issue is resolved for me.

Would you like me to replace MbedException(n) with Base.IOError(strerror(n), n) in ssl_abandon anyways?

Should we also make the swap in handshake while at it? That's the last remaining reference to MbedException in this file.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's switch them all to IOError; thanks.

Copy link
Member

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

Thanks!

@quinnj quinnj merged commit 1b77757 into JuliaLang:master Oct 21, 2022
@gustafsson gustafsson deleted the ioerror-in-closewrite branch October 25, 2022 13:34
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.

MbedException or IOError?
2 participants