From 336c45eaa23f6ff9b6861b12629f6adee682a48e Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 19 May 2012 05:40:58 +0000 Subject: merge revision(s) 35422: * lib/drb/ssl.rb: close accepted TCP socket if SSL accept is failed. [ruby-dev:45541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/drb/ssl.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/drb/ssl.rb b/lib/drb/ssl.rb index 17e2a73d85..ebd648b256 100644 --- a/lib/drb/ssl.rb +++ b/lib/drb/ssl.rb @@ -177,7 +177,11 @@ module DRb break if (@acl ? @acl.allow_socket?(soc) : true) soc.close end - ssl = @config.accept(soc) + begin + ssl = @config.accept(soc) + ensure + soc.close if $! + end self.class.new(uri, ssl, @config, true) rescue OpenSSL::SSL::SSLError warn("#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})") if @config[:verbose] -- cgit v1.2.3