From: Giuseppe Bilotta Date: Sun, 25 Mar 2007 20:08:56 +0000 (+0000) Subject: HttpUtil: fix partial_body when no body was given, and increase default info_bytes... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=9556f99333f92696b7549b897e5992310dc5577e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git HttpUtil: fix partial_body when no body was given, and increase default info_bytes to 8k --- diff --git a/lib/rbot/core/utils/httputil.rb b/lib/rbot/core/utils/httputil.rb index 904e1941..aebd1e81 100644 --- a/lib/rbot/core/utils/httputil.rb +++ b/lib/rbot/core/utils/httputil.rb @@ -29,7 +29,7 @@ module ::Net self.read_body { |chunk| partial << chunk - yield partial + yield partial if block_given? break if size and size > 0 and partial.length >= size } @@ -76,7 +76,7 @@ class HttpUtil :default => false, :desc => "Set this to true if you want the bot to never expire the cached pages") BotConfig.register BotConfigIntegerValue.new('http.info_bytes', - :default => 4096, + :default => 8192, :desc => "How many bytes to download from a web page to find some information. Set to 0 to let the bot download the whole page.") def initialize(bot)