diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-19 16:13:21 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-07-19 16:13:21 +0000 |
commit | ce7b848f47a78a0f2ef6c3c5e6cefdd7b859f753 (patch) | |
tree | 20f926d42608bf1be8a45ffc2c8ec1fd3210e0f0 /rbot | |
parent | 198f43f61a0b55da01a9c4994412f9c0219adea9 (diff) |
at some point over the last couple of years, the ruby http library started
throwing timeout exceptions from .new, wheras they used to come from .get.
This means timeouts kill the bot so I've moved all the http code into the
begin block.
Diffstat (limited to 'rbot')
-rw-r--r-- | rbot/utils.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rbot/utils.rb b/rbot/utils.rb index 36276e8d..b22a417d 100644 --- a/rbot/utils.rb +++ b/rbot/utils.rb @@ -162,11 +162,11 @@ module Irc 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| resp = http.get(query) if resp.code == "200" |