diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-11-19 00:06:23 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-11-19 00:06:23 +0000 |
commit | 24e6cbc724b006ea4febb1948b921387e9021177 (patch) | |
tree | 840c11ae0b25e4cf66a15b25fa0470bb4dc8a9a9 /activeresource | |
parent | a76490d91758e775dc4facd8a3b577a60afc175e (diff) | |
download | rails-24e6cbc724b006ea4febb1948b921387e9021177.tar.gz rails-24e6cbc724b006ea4febb1948b921387e9021177.tar.bz2 rails-24e6cbc724b006ea4febb1948b921387e9021177.zip |
Don't cache net/http object so that ActiveResource is more thread-safe. Closes #10142 [kou]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource')
-rw-r--r-- | activeresource/CHANGELOG | 2 | ||||
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/activeresource/CHANGELOG b/activeresource/CHANGELOG index 46158cb208..7527424070 100644 --- a/activeresource/CHANGELOG +++ b/activeresource/CHANGELOG @@ -1,3 +1,5 @@ +* Don't cache net/http object so that ActiveResource is more thread-safe. Closes #10142 [kou] + * Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh] *2.0.0 [Preview Release]* (September 29th, 2007) diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index 5f86d77a26..46d462dbe7 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -127,16 +127,13 @@ module ActiveResource end end - # Creates new (or uses currently instantiated) Net::HTTP instance for communication with + # Creates new Net::HTTP instance for communication with # remote service and resources. def http - unless @http - @http = Net::HTTP.new(@site.host, @site.port) - @http.use_ssl = @site.is_a?(URI::HTTPS) - @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @http.use_ssl - end - - @http + http = Net::HTTP.new(@site.host, @site.port) + http.use_ssl = @site.is_a?(URI::HTTPS) + http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl + http end def default_header @@ -157,4 +154,4 @@ module ActiveResource ActiveResource::Base.logger end end -end
\ No newline at end of file +end |