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

ssl: fix SSLSocket#sysread leaking locktmp String on timeout #832

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Dec 21, 2024

Commit 3bbf517 made blocking methods on SSLSocket follow the IO#timeout= value. The commit changed io_wait_readable() to potentially raise an exception without unlocking the String.

The String is currently locked for the entire duration of a #sysread method call. This does not seem to be necessary, as SSL_read() does not require that the same buffer is specified when retrying. Locking the String during each SSL_read() call should be sufficient.

Commit 3bbf517 made blocking methods on SSLSocket follow the
IO#timeout= value. The commit changed io_wait_readable() to potentially
raise an exception without unlocking the String.

The String is currently locked for the entire duration of a #sysread
method call. This does not seem to be necessary, as SSL_read() does not
require that the same buffer is specified when retrying. Locking the
String during each SSL_read() call should be sufficient.
@rhenium rhenium force-pushed the ky/ssl-read-unlock-str-timeout branch from 744ccb8 to 8f791d7 Compare December 21, 2024 16:01
@rhenium rhenium changed the title ssl: fix SSLSocket#sysread leaking tmplock String on timeout ssl: fix SSLSocket#sysread leaking locktmp String on timeout Dec 21, 2024
@rhenium rhenium changed the base branch from master to maint-3.3 January 14, 2025 11:57
@rhenium rhenium merged commit a0bf65f into ruby:maint-3.3 Jan 14, 2025
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant