From 3ac2c3472af0dfce9a79ed3ffa6ed720caaf98e2 Mon Sep 17 00:00:00 2001 From: mame Date: Mon, 30 Jun 2008 14:15:48 +0000 Subject: [PATCH] * test/openssl/test_ssl.rb (start_server): shutdown TCPServer before close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/openssl/test_ssl.rb | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b9c70555d..67d04b92f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jun 30 23:15:07 2008 Yusuke Endoh + + * test/openssl/test_ssl.rb (start_server): shutdown TCPServer before + close. + Mon Jun 30 23:01:50 2008 Nobuyoshi Nakada * common.mk (RUBY_H_INCLUDES): common headers which are included with diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 50659f1b3b..876ca4c685 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -128,14 +128,19 @@ class OpenSSL::TestSSL < Test::Unit::TestCase block.call(server, port.to_i) ensure - tcps.close if (tcps) - if (server) - server.join(5) - if server.alive? - server.kill - server.join - flunk("TCPServer was closed and SSLServer is still alive") unless $! + tcps.shutdown if (tcps) + begin + if (server) + server.join(5) + if server.alive? + server.kill + server.join + flunk("TCPServer was closed and SSLServer is still alive") unless $! + end end + rescue Errno::EINVAL, Errno::EBADF + ensure + tcps.close if (tcps) end end end