1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/lib/puma/accept_nonblock.rb
Nate Berkopec 4c85facff3
Test cleanup and parallelization (#1846)
* Add frozen string literal everywhere it wasnt already

* Enforce stopgap for tests

* Small amount of integration test cleanup

* Parallelize and freeze Test_app_status

* Big cleanup for test_binder

* Whitespace fix
2019-07-16 18:53:28 -04:00

25 lines
517 B
Ruby

# frozen_string_literal: true
require 'openssl'
module OpenSSL
module SSL
class SSLServer
unless public_method_defined? :accept_nonblock
def accept_nonblock
sock = @svr.accept_nonblock
begin
ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
ssl.sync_close = true
ssl.accept if @start_immediately
ssl
rescue SSLError => ex
sock.close
raise ex
end
end
end
end
end
end