summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-03-25 20:08:56 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-03-25 20:08:56 +0000
commit9556f99333f92696b7549b897e5992310dc5577e (patch)
tree6e8fdd801fba23e8dfd67669f3ce48bbb20b90d6
parentc671bf49230781ed80d9fa80577fed9b1b655a99 (diff)
HttpUtil: fix partial_body when no body was given, and increase default info_bytes to 8k
-rw-r--r--lib/rbot/core/utils/httputil.rb4
1 files changed, 2 insertions, 2 deletions
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)