about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--Rakefile2
-rw-r--r--lib/mongrel/debug.rb30
2 files changed, 19 insertions, 13 deletions
diff --git a/Rakefile b/Rakefile
index 213b33e..13b8afc 100644
--- a/Rakefile
+++ b/Rakefile
@@ -33,7 +33,7 @@ task :ragel do
 end
 
 task :site_webgen do
-  sh %{pushd doc/site; webgen; scp -r output/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
+  sh %{pushd doc/site; webgen; scp -r `find output -name "*.html" -print` #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
 end
 
 task :site_rdoc do
diff --git a/lib/mongrel/debug.rb b/lib/mongrel/debug.rb
index 48a300a..2a13ae5 100644
--- a/lib/mongrel/debug.rb
+++ b/lib/mongrel/debug.rb
@@ -79,12 +79,14 @@ module ObjectTracker
     ospace = Set.new
     counts = {}
     
-    # Strings can't be tracked easily and are so numerous that they drown out all else
-    # so we just ignore them in the counts.
     ObjectSpace.each_object do |obj|
-      ospace << obj.object_id
-      counts[obj.class] ||= 0
-      counts[obj.class] += 1
+      begin
+        ospace << obj.object_id
+        counts[obj.class] ||= 0
+        counts[obj.class] += 1
+      rescue Object
+        # skip since object_id can magically get parameters
+      end
     end
     
     dead_objects = @active_objects - ospace
@@ -194,15 +196,19 @@ module RequestLog
     def process(request, response)
       MongrelDbg::trace(:threads, "#{Time.now} REQUEST #{request.params['PATH_INFO']}")
       ObjectSpace.each_object do |obj|
-        if obj.class == Mongrel::HttpServer
-          worker_list = obj.workers.list
+        begin
+          if obj.class == Mongrel::HttpServer
+            worker_list = obj.workers.list
 
-          if worker_list.length > 0
-            keys = "-----\n\tKEYS:"
-            worker_list.each {|t| keys << "\n\t\t-- #{t}: #{t.keys.inspect}" }
-          end
+            if worker_list.length > 0
+              keys = "-----\n\tKEYS:"
+              worker_list.each {|t| keys << "\n\t\t-- #{t}: #{t.keys.inspect}" }
+            end
 
-          MongrelDbg::trace(:threads, "#{obj.host}:#{obj.port} -- THREADS: #{worker_list.length} #{keys}")
+            MongrelDbg::trace(:threads, "#{obj.host}:#{obj.port} -- THREADS: #{worker_list.length} #{keys}")
+          end
+        rescue Object
+          # ignore since obj.class can sometimes take parameters
         end
       end
     end