proxy_port = proxy_uri.port
end
- http = Net::HTTP.new(uri.host, uri.port, proxy_host, proxy_port)
- http.open_timeout = opentimeout
- http.read_timeout = readtimeout
+ begin
+ http = Net::HTTP.new(uri.host, uri.port, proxy_host, proxy_port)
+ http.open_timeout = opentimeout
+ http.read_timeout = readtimeout
- http.start {|http|
- begin
+ http.start {|http|
resp = http.get(query)
if resp.code == "200"
return resp.body
end
- rescue => e
- # cheesy for now
- $stderr.puts "Utils.http_get exception: #{e}, while trying to get #{uristr}"
- return nil
- end
- }
+ }
+ rescue => e
+ # cheesy for now
+ $stderr.puts "Utils.http_get exception: #{e}, while trying to get #{uristr}"
+ return nil
+ end
end
# This is nasty-ass. I hate writing parsers.