mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
f4b417eb43
commit
3ec72f078c
4 changed files with 34 additions and 22 deletions
|
@ -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>
|
||||
|
||||
* test/openssl/test_ssl_session.rb (test_ctx_client_session_cb): Don't
|
||||
|
|
|
@ -66,6 +66,7 @@ class LeakChecker
|
|||
end
|
||||
puts "Leaked file descriptor: #{test_name}: #{fd}#{str}"
|
||||
}
|
||||
#system("lsof -p #$$") if !fd_leaked.empty?
|
||||
h.each {|fd, list|
|
||||
next if list.length <= 1
|
||||
if 1 < list.count {|io, autoclose, inspect| autoclose }
|
||||
|
|
|
@ -32,11 +32,14 @@ tddwpBAEDjcwMzA5NTYzMTU1MzAwpQMCARM=
|
|||
ctx.session_id_context = self.object_id.to_s
|
||||
|
||||
sock = TCPSocket.new '127.0.0.1', port
|
||||
ssl = OpenSSL::SSL::SSLSocket.new sock, ctx
|
||||
ssl.session = session
|
||||
begin
|
||||
ssl = OpenSSL::SSL::SSLSocket.new sock, ctx
|
||||
ssl.session = session
|
||||
|
||||
assert_equal session, ssl.session
|
||||
sock.close
|
||||
assert_equal session, ssl.session
|
||||
ensure
|
||||
sock.close
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -299,28 +299,31 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
|
|||
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
|
||||
ssls.start_immediately = start_immediately
|
||||
|
||||
server = Thread.new do
|
||||
server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
|
||||
end
|
||||
threads.unshift server
|
||||
|
||||
$stderr.printf("%s started: pid=%d port=%d\n", SSL_SERVER, $$, port) if $DEBUG
|
||||
|
||||
th = Thread.new do
|
||||
begin
|
||||
block.call(server, port.to_i)
|
||||
ensure
|
||||
stop_pipe_w.close
|
||||
end
|
||||
end
|
||||
begin
|
||||
th.join
|
||||
rescue Exception
|
||||
threads.unshift th
|
||||
server = Thread.new do
|
||||
server_loop(ctx, ssls, stop_pipe_r, ignore_ssl_accept_error, server_proc, threads)
|
||||
end
|
||||
threads.unshift server
|
||||
|
||||
$stderr.printf("%s started: pid=%d port=%d\n", SSL_SERVER, $$, port) if $DEBUG
|
||||
|
||||
th = Thread.new do
|
||||
begin
|
||||
block.call(server, port.to_i)
|
||||
ensure
|
||||
stop_pipe_w.close
|
||||
end
|
||||
end
|
||||
begin
|
||||
th.join
|
||||
rescue Exception
|
||||
threads.unshift th
|
||||
end
|
||||
ensure
|
||||
assert_join_threads(threads)
|
||||
end
|
||||
ensure
|
||||
tcps.close if tcps
|
||||
assert_join_threads(threads)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue