Method: Gem::Request::ConnectionPools#pool_for

Defined in:
lib/rubygems/request/connection_pools.rb

#pool_for(uri) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rubygems/request/connection_pools.rb', line 17

def pool_for(uri)
  http_args = net_http_args(uri, @proxy_uri)
  key       = http_args + [https?(uri)]
  @pool_mutex.synchronize do
    @pools[key] ||=
      if https? uri
        Gem::Request::HTTPSPool.new(http_args, @cert_files, @proxy_uri)
      else
        Gem::Request::HTTPPool.new(http_args, @cert_files, @proxy_uri)
      end
  end
end