summaryrefslogtreecommitdiff
path: root/lib/rubygems/request
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/request')
-rw-r--r--lib/rubygems/request/connection_pools.rb6
-rw-r--r--lib/rubygems/request/http_pool.rb9
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