]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
HttpUtil: fix partial_body when no body was given, and increase default info_bytes...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 25 Mar 2007 20:08:56 +0000 (20:08 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 25 Mar 2007 20:08:56 +0000 (20:08 +0000)
lib/rbot/core/utils/httputil.rb

index 904e194114ece4fbd71500d6c9aedf64401a20e1..aebd1e81354a920f62d4d7e8f7bbfae8ae5565f5 100644 (file)
@@ -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)