ignore_ssl_accept_error option is changed to ignore_listener_error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-11-01 15:56:29 +00:00
Родитель c21ae1e1fd
Коммит a25e9259d5
2 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -292,7 +292,7 @@ __EOS__
# any resulting value is OK (ignored)
}
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ignore_ssl_accept_error: false) do |server, port|
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ignore_listener_error: false) do |server, port|
sock = TCPSocket.new("127.0.0.1", port)
begin
ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
@ -350,7 +350,7 @@ __EOS__
c.session_cache_stats
readwrite_loop(c, ssl)
}
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ctx_proc: ctx_proc, server_proc: server_proc, ignore_ssl_accept_error: false) do |server, port|
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, ctx_proc: ctx_proc, server_proc: server_proc, ignore_listener_error: false) do |server, port|
last_client_session = nil
3.times do
sock = TCPSocket.new("127.0.0.1", port)

Просмотреть файл

@ -240,7 +240,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
ssl.close rescue nil
end
def server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
def server_loop(ctx, ssls, stop_pipe_r, ignore_listener_error, server_proc, threads)
loop do
ssl = nil
begin
@ -250,7 +250,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
end
ssl = ssls.accept
rescue OpenSSL::SSL::SSLError
if ignore_ssl_accept_error
if ignore_listener_error
retry
else
raise
@ -263,13 +263,16 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
threads << th
end
rescue Errno::EBADF, IOError, Errno::EINVAL, Errno::ECONNABORTED, Errno::ENOTSOCK, Errno::ECONNRESET
if !ignore_listener_error
raise
end
end
def start_server(port0, verify_mode, start_immediately, args = {}, &block)
IO.pipe {|stop_pipe_r, stop_pipe_w|
ctx_proc = args[:ctx_proc]
server_proc = args[:server_proc]
ignore_ssl_accept_error = args.fetch(:ignore_ssl_accept_error, true)
ignore_listener_error = args.fetch(:ignore_listener_error, true)
server_proc ||= method(:readwrite_loop)
store = OpenSSL::X509::Store.new
@ -301,7 +304,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
begin
server = Thread.new do
begin
server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
server_loop(ctx, ssls, stop_pipe_r, ignore_listener_error, server_proc, threads)
ensure
tcps.close
end