* test/openssl/utils.rb (start_server): Don't close sockets before

threads finished.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-11-01 14:12:11 +00:00
Родитель f4b417eb43
Коммит 3ec72f078c
4 изменённых файлов: 34 добавлений и 22 удалений

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

@ -1,3 +1,8 @@
Sat Nov 1 23:11:05 2014 Tanaka Akira <akr@fsij.org>
* test/openssl/utils.rb (start_server): Don't close sockets before
threads finished.
Sat Nov 1 22:06:24 2014 Tanaka Akira <akr@fsij.org> Sat Nov 1 22:06:24 2014 Tanaka Akira <akr@fsij.org>
* test/openssl/test_ssl_session.rb (test_ctx_client_session_cb): Don't * test/openssl/test_ssl_session.rb (test_ctx_client_session_cb): Don't

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

@ -66,6 +66,7 @@ class LeakChecker
end end
puts "Leaked file descriptor: #{test_name}: #{fd}#{str}" puts "Leaked file descriptor: #{test_name}: #{fd}#{str}"
} }
#system("lsof -p #$$") if !fd_leaked.empty?
h.each {|fd, list| h.each {|fd, list|
next if list.length <= 1 next if list.length <= 1
if 1 < list.count {|io, autoclose, inspect| autoclose } if 1 < list.count {|io, autoclose, inspect| autoclose }

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

@ -32,11 +32,14 @@ tddwpBAEDjcwMzA5NTYzMTU1MzAwpQMCARM=
ctx.session_id_context = self.object_id.to_s ctx.session_id_context = self.object_id.to_s
sock = TCPSocket.new '127.0.0.1', port sock = TCPSocket.new '127.0.0.1', port
begin
ssl = OpenSSL::SSL::SSLSocket.new sock, ctx ssl = OpenSSL::SSL::SSLSocket.new sock, ctx
ssl.session = session ssl.session = session
assert_equal session, ssl.session assert_equal session, ssl.session
ensure
sock.close sock.close
end
} }
end end

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

@ -299,6 +299,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx) ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
ssls.start_immediately = start_immediately ssls.start_immediately = start_immediately
begin
server = Thread.new do server = Thread.new do
server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads) server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
end end
@ -319,9 +320,11 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
threads.unshift th threads.unshift th
end end
ensure ensure
tcps.close if tcps
assert_join_threads(threads) assert_join_threads(threads)
end end
ensure
tcps.close if tcps
end
} }
end end