Skip to content

Commit 76bc4f0

Browse files
committed
fixup! fixup! ssl: support SSLSocket#connect and #accept with timeout
1 parent 8bf8a0e commit 76bc4f0

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/openssl/ssl.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,8 @@ def sysclose
378378
end
379379

380380
private def with_timeout(timeout)
381-
begin
382-
timeout ||= self.timeout
383-
rescue NoMethodError
384-
end
381+
# IO#timeout= was added in Ruby 3.2
382+
timeout ||= self.timeout if IO.method_defined?(:timeout)
385383
if timeout.nil?
386384
while true
387385
yield

0 commit comments

Comments
 (0)