From d35a2bd4dfdb974ff741736ad27b420c40365515 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 17 Nov 2014 03:55:02 +0000 Subject: * lib/rubygems/*, test/rubygems/*: Update to RubyGems 2.4.4 master (2f6e42e). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/request/connection_pools.rb | 6 +++++- lib/rubygems/request/http_pool.rb | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/rubygems/request') diff --git a/lib/rubygems/request/connection_pools.rb b/lib/rubygems/request/connection_pools.rb index 27ee99c20d..7a0a6e6e74 100644 --- a/lib/rubygems/request/connection_pools.rb +++ b/lib/rubygems/request/connection_pools.rb @@ -28,6 +28,10 @@ class Gem::Request::ConnectionPools # :nodoc: end end + def close_all + @pools.each_value {|pool| pool.close_all} + end + private ## @@ -69,7 +73,7 @@ class Gem::Request::ConnectionPools # :nodoc: Gem::UriFormatter.new(proxy_uri.password).unescape, ] elsif no_proxy? uri.host, no_proxy then - net_http_args += [nil, nil] + net_http_args + [nil, nil] else net_http_args end diff --git a/lib/rubygems/request/http_pool.rb b/lib/rubygems/request/http_pool.rb index 61c8884af7..c9a1858b98 100644 --- a/lib/rubygems/request/http_pool.rb +++ b/lib/rubygems/request/http_pool.rb @@ -23,6 +23,15 @@ class Gem::Request::HTTPPool # :nodoc: @queue.push connection end + def close_all + until @queue.empty? + if connection = @queue.pop(true) and connection.started? + connection.finish + end + end + @queue.push(nil) + end + private def make_connection -- cgit v1.2.3