diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-09 11:36:07 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-09 11:36:07 -0700 |
commit | c6659b70deb4b1f81bc5c20ed237b7637ff20930 (patch) | |
tree | ce30b50646147e5c90458967830cb124211a3d61 /lib/chef/http.rb | |
parent | 27cfcdb4cc6fdd7a52e3edb570297709f2bfe715 (diff) | |
download | chef-c6659b70deb4b1f81bc5c20ed237b7637ff20930.tar.gz |
cache correctly
Diffstat (limited to 'lib/chef/http.rb')
-rw-r--r-- | lib/chef/http.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb index d7150a50dd..04256b7510 100644 --- a/lib/chef/http.rb +++ b/lib/chef/http.rb @@ -232,16 +232,15 @@ class Chef def http_client(base_url = nil) base_url ||= url - client = build_http_client(base_url) if keepalives && !base_url.nil? # only reuse the http_client if we want keepalives and have a base_url @http_client ||= {} # the per-host per-port cache here gets peristent connections correct when # redirecting to different servers @http_client[base_url.host] ||= {} - @http_client[base_url.host][base_url.port] ||= client + @http_client[base_url.host][base_url.port] ||= build_http_client(base_url) else - client + build_http_client(base_url) end end |