-
Notifications
You must be signed in to change notification settings - Fork 10
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
Summary of changes in this commit: #18
Conversation
* Factor ERR_clear_error into its own function and call in the geterror macro right before we do SSL IO operations; the openssl docs recommend this and trying to keep your error stack as clean as possible * Add :acquire/:release memory orderings to our atomic operations; shouldn't make that big of a difference, but more semantically correct with how we define our atomicget/atomicset macros * Instead of call `eof(ssl)` before each SSL_read_ex call, we instead only check that the ssl is open, then optimistically call SSL_read_ex; if there are buffered bytes, they'll be processed and we saved ourselves an `eof` call; if SSL_read_ex returns SSL_WANT_READ, then we'll call `eof` anyway afterwards * Remove the finalizer on our SSL struct; @kpamnany recommended avoiding finalizers and we already have really well defined create/destroy moments for SSLs, so we don't need to be messing w/ the global finalizer list * Remove 2 `update_tls_error_state` calls in SSL_pending and SSL_has_pending; these aren't needed because the openssl documentation mentions specifically these don't use the same error reporting as IO functions * Also tweaked our eof call to avoid allocating a Ref{UInt8} each time it is called
Codecov Report
@@ Coverage Diff @@
## main #18 +/- ##
==========================================
- Coverage 75.78% 75.70% -0.09%
==========================================
Files 2 2
Lines 1049 1062 +13
==========================================
+ Hits 795 804 +9
- Misses 254 258 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Nick Robinson <[email protected]>
Thanks for the great review + suggestions @nickrobinson251; GitHub was being super weird and the UI wasn't working very well, so I managed to commit a few of your changes and made the others locally and pushed. Should be all addressed now! |
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.
this is my first time reviewing on this package, but the changes make sense to me
I think ideally we'd have higher test coverage on this repo -- maybe we can open an issue about that?
Yeah, that's a good point. And honestly, the easiest part is probably just removing most of the code in the OpenSSL.jl file, since we don't really use it/depend on it for the SSLStream stuff. I've opened this issue to follow up on that. |
eof(ssl)
before each SSL_read_ex call, we instead only check that the ssl is open, then optimistically call SSL_read_ex; if there are buffered bytes, they'll be processed and we saved ourselves aneof
call; if SSL_read_ex returns SSL_WANT_READ, then we'll calleof
anyway afterwardsupdate_tls_error_state
calls in SSL_pending and SSL_has_pending; these aren't needed because the openssl documentation mentions specifically these don't use the same error reporting as IO functions