ssl: implement blocking SSLSocket methods in Ruby - #1105
Open
rhenium wants to merge 1 commit into
Open
Conversation
Let the extension only provide the most basic non-blocking form,
SSLSocket#ssl_connect, #ssl_accept, #ssl_read, #ssl_write.
Implement SSLSocket#connect, #accept, #sysread, and #syswrite in
lib/openssl/ssl.rb on top of these primitives and #wait_{read,writ}able.
Also, handle the keyword arguments for the public #*_nonblock methods
in Ruby to simplify and to avoid the Hash allocation.
This prepares for the upcoming changes to SSLSocket to add proper
timeout support and socket closed state tracking. These would be easier
to do in Ruby.
No user-visible behavior change is intended with this patch.
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Let the extension only provide the most basic non-blocking form,
SSLSocket#ssl_connect,#ssl_accept,#ssl_read,#ssl_write.Implement
SSLSocket#connect,#accept,#sysread, and#syswriteinlib/openssl/ssl.rbon top of these primitives and#wait_{read,writ}able.Also, handle the keyword arguments for the public
#*_nonblockmethods in Ruby to simplify and to avoid theHashallocation.This prepares for the upcoming changes to
SSLSocketto add proper timeout support and socket closed state tracking. These would be easier to do in Ruby.No user-visible behavior change is intended with this patch.