diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-07-19 15:57:39 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-07-19 15:57:39 -0700 |
| commit | e8a2287cdac5dbf086b60af65e301f3e2360ee2b (patch) | |
| tree | 1c565e2c754f3cb43f4e0dc8fa7bb5e81a40d064 /lib | |
| parent | c1e83597712f4553960b42aebc3ab45ae272e724 (diff) | |
| parent | 185a666018c0cf0b2c497f655f942a82cd22e49e (diff) | |
| download | puppet-e8a2287cdac5dbf086b60af65e301f3e2360ee2b.tar.gz puppet-e8a2287cdac5dbf086b60af65e301f3e2360ee2b.tar.xz puppet-e8a2287cdac5dbf086b60af65e301f3e2360ee2b.zip | |
Merge branch 'remove-http-pool-keep-alive'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/configurer.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/network/client.rb | 5 | ||||
| -rw-r--r-- | lib/puppet/network/http_pool.rb | 55 |
3 files changed, 0 insertions, 64 deletions
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb index 3d6e8557c..5581917a1 100644 --- a/lib/puppet/configurer.rb +++ b/lib/puppet/configurer.rb @@ -161,10 +161,6 @@ class Puppet::Configurer # Make sure we forget the retained module_directories of any autoload # we might have used. Thread.current[:env_module_directories] = nil - - # Now close all of our existing http connections, since there's no - # reason to leave them lying open. - Puppet::Network::HttpPool.clear_http_instances end ensure Puppet::Util::Log.close(report) diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb index c56b21393..f9c4c5fea 100644 --- a/lib/puppet/network/client.rb +++ b/lib/puppet/network/client.rb @@ -82,11 +82,6 @@ class Puppet::Network::Client self.read_cert - # We have to start the HTTP connection manually before we start - # sending it requests or keep-alive won't work. Note that with #1010, - # we don't currently actually want keep-alive. - @driver.start if @driver.respond_to? :start and Puppet::Network::HttpPool.keep_alive? - @local = false elsif hash.include?(driverparam) @driver = hash[driverparam] diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb index 7d227b4d4..d4ec48d22 100644 --- a/lib/puppet/network/http_pool.rb +++ b/lib/puppet/network/http_pool.rb @@ -4,50 +4,12 @@ require 'puppet/util/cacher' module Puppet::Network; end -# Manage Net::HTTP instances for keep-alive. module Puppet::Network::HttpPool - class << self - include Puppet::Util::Cacher - - private - - cached_attr(:http_cache) { Hash.new } - end - # Use the global localhost instance. def self.ssl_host Puppet::SSL::Host.localhost end - # 2008/03/23 - # LAK:WARNING: Enabling this has a high propability of - # causing corrupt files and who knows what else. See #1010. - HTTP_KEEP_ALIVE = false - - def self.keep_alive? - HTTP_KEEP_ALIVE - end - - # Clear our http cache, closing all connections. - def self.clear_http_instances - http_cache.each do |name, connection| - connection.finish if connection.started? - end - Puppet::Util::Cacher.expire - end - - # Make sure we set the driver up when we read the cert in. - def self.read_cert - if val = super # This calls read_cert from the Puppet::SSLCertificates::Support module. - # Clear out all of our connections, since they previously had no cert and now they - # should have them. - clear_http_instances - return val - else - return false - end - end - # Use cert information from a Puppet client to set up the http object. def self.cert_setup(http) # Just no-op if we don't have certs. @@ -63,21 +25,6 @@ module Puppet::Network::HttpPool # Retrieve a cached http instance if caching is enabled, else return # a new one. def self.http_instance(host, port, reset = false) - # We overwrite the uninitialized @http here with a cached one. - key = "#{host}:#{port}" - - # Return our cached instance if we've got a cache, as long as we're not - # resetting the instance. - if keep_alive? - return http_cache[key] if ! reset and http_cache[key] - - # Clean up old connections if we have them. - if http = http_cache[key] - http_cache.delete(key) - http.finish if http.started? - end - end - args = [host, port] if Puppet[:http_proxy_host] == "none" args << nil << nil @@ -97,8 +44,6 @@ module Puppet::Network::HttpPool cert_setup(http) - http_cache[key] = http if keep_alive? - http end end |
