From ce7b848f47a78a0f2ef6c3c5e6cefdd7b859f753 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Tue, 19 Jul 2005 16:13:21 +0000 Subject: 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. --- rbot/utils.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rbot') 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" -- cgit v1.2.3