Skip to content

Commit

Permalink
Add configurable timeouts from Active Merchant
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Fauser committed Sep 18, 2008
1 parent 08a25c3 commit c2f25b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Add configurable timeouts from Active Merchant [cody]
* Update xml_node.rb from XML Node [cody]
* Update requires_parameters from ActiveMerchant [cody]
* Sync posts_data.rb with ActiveMerchant [cody]
Expand Down
10 changes: 8 additions & 2 deletions lib/active_shipping/lib/posts_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def self.included(base)

base.class_inheritable_accessor :retry_safe
base.retry_safe = false

base.superclass_delegating_accessor :open_timeout
base.open_timeout = OPEN_TIMEOUT

base.superclass_delegating_accessor :read_timeout
base.read_timeout = READ_TIMEOUT
end

def ssl_post(url, data, headers = {})
Expand All @@ -28,8 +34,8 @@ def ssl_post(url, data, headers = {})
uri = URI.parse(url)

http = Net::HTTP.new(uri.host, uri.port)
http.open_timeout = OPEN_TIMEOUT
http.read_timeout = READ_TIMEOUT
http.open_timeout = self.class.open_timeout
http.read_timeout = self.class.read_timeout
http.use_ssl = true

if ssl_strict
Expand Down

0 comments on commit c2f25b4

Please sign in to comment.