Changeset 1614
- Timestamp:
- 09/12/05 21:31:15 (3 years ago)
- Files:
-
- trunk/lib/soap/streamHandler.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/streamHandler.rb
r1606 r1614 21 21 22 22 class StreamHandler 23 Client = begin24 require 'http-access2'25 if HTTPAccess2::VERSION < "2.0"26 raise LoadError.new("http-access/2.0 or later is required.")27 end28 HTTPAccess2::Client29 rescue LoadError30 warn("Loading http-access2 failed. Net/http is used.") if $DEBUG31 require 'soap/netHttpClient'32 SOAP::NetHttpClient33 end34 35 23 RUBY_VERSION_STRING = "ruby #{ RUBY_VERSION } (#{ RUBY_RELEASE_DATE }) [#{ RUBY_PLATFORM }]" 36 37 RETRYABLE = (Client == HTTPAccess2::Client)38 24 39 25 class ConnectionData … … 73 59 include SOAP 74 60 61 begin 62 require 'http-access2' 63 if HTTPAccess2::VERSION < "2.0" 64 raise LoadError.new("http-access/2.0 or later is required.") 65 end 66 Client = HTTPAccess2::Client 67 RETRYABLE = true 68 rescue LoadError 69 warn("Loading http-access2 failed. Net/http is used.") if $DEBUG 70 require 'soap/netHttpClient' 71 Client = SOAP::NetHttpClient 72 RETRYABLE = false 73 end 74 75 75 76 public 76 77 … … 78 79 attr_accessor :wiredump_file_base 79 80 80 NofRetry= 10 # [times]81 MAX_RETRY_COUNT = 10 # [times] 81 82 82 83 def initialize(options) … … 170 171 if RETRYABLE and HTTP::Status.redirect?(res.status) 171 172 retry_count += 1 172 if retry_count >= 10173 if retry_count >= MAX_RETRY_COUNT 173 174 raise HTTPStreamError.new("redirect count exceeded") 174 175 end