diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-17 03:55:02 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-17 03:55:02 +0000 |
commit | d35a2bd4dfdb974ff741736ad27b420c40365515 (patch) | |
tree | 2a8542408af557908a28fba1df80c21ecf10f7aa /lib/rubygems/request | |
parent | 1133596e6ba77ddeb93552fc8274a3bbdd87e6f3 (diff) |
* 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
Diffstat (limited to 'lib/rubygems/request')
-rw-r--r-- | lib/rubygems/request/connection_pools.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/request/http_pool.rb | 9 |
2 files changed, 14 insertions, 1 deletions
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 |