Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8167

Show
Ignore:
Timestamp:
11/19/07 00:06:23 (9 months ago)
Author:
rick
Message:

Don't cache net/http object so that ActiveResource is more thread-safe. Closes #10142 [kou]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activeresource/CHANGELOG

    r8090 r8167  
     1* Don't cache net/http object so that ActiveResource is more thread-safe.  Closes #10142 [kou] 
     2 
    13* Update XML documentation examples to include explicit type attributes. Closes #9754 [hasmanyjosh] 
    24 
  • trunk/activeresource/lib/active_resource/connection.rb

    r7518 r8167  
    128128      end 
    129129 
    130       # Creates new (or uses currently instantiated) Net::HTTP instance for communication with 
     130      # Creates new Net::HTTP instance for communication with 
    131131      # remote service and resources. 
    132132      def http 
    133         unless @http 
    134           @http             = Net::HTTP.new(@site.host, @site.port) 
    135           @http.use_ssl     = @site.is_a?(URI::HTTPS) 
    136           @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @http.use_ssl 
    137         end 
    138  
    139         @http 
     133        http             = Net::HTTP.new(@site.host, @site.port) 
     134        http.use_ssl     = @site.is_a?(URI::HTTPS) 
     135        http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl 
     136        http 
    140137      end 
    141138