about summary refs log tree commit homepage
path: root/lib/mongrel.rb
diff options
context:
space:
mode:
authorfilipe <filipe@19e92222-5c0b-0410-8929-a290d50e31e9>2007-09-13 04:43:54 +0000
committerfilipe <filipe@19e92222-5c0b-0410-8929-a290d50e31e9>2007-09-13 04:43:54 +0000
commitb5d757376793fcad801826ec9d81dd10dcc59c95 (patch)
tree5e3d6696eb4b99b61db67689073192490c5b05bd /lib/mongrel.rb
parent706aef01fbbcee885fcb6d76228f669d48d16f25 (diff)
downloadunicorn-b5d757376793fcad801826ec9d81dd10dcc59c95.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@587 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel.rb')
-rw-r--r--lib/mongrel.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index ef85e97..d1ef990 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -270,9 +270,9 @@ module Mongrel
         end
       rescue Object
         STDERR.puts "ERROR reading http body: #$!"
-        $!.backtrace.join("\n")
+        STDERR.puts $!.backtrace.join("\n") if $mongrel_debug_client
         # any errors means we should delete the file, including if the file is dumped
-        @socket.close rescue Object
+        @socket.close rescue nil
         @body.delete if @body.class == Tempfile
         @body = nil # signals that there was a problem
       end
@@ -489,7 +489,7 @@ module Mongrel
 
     def socket_error(details)
       # ignore these since it means the client closed off early
-      @socket.close rescue Object
+      @socket.close rescue nil
       done = true
       raise details
     end
@@ -654,7 +654,7 @@ module Mongrel
           end
         end
       rescue EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL,Errno::EBADF
-        client.close rescue Object
+        client.close rescue nil
       rescue HttpParserError
         if $mongrel_debug_client
           STDERR.puts "#{Time.now}: BAD CLIENT (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #$!"
@@ -666,7 +666,7 @@ module Mongrel
         STDERR.puts "#{Time.now}: ERROR: #$!"
         STDERR.puts $!.backtrace.join("\n") if $mongrel_debug_client
       ensure
-        client.close rescue Object
+        client.close rescue nil
         request.body.delete if request and request.body.class == Tempfile
       end
     end
@@ -745,7 +745,7 @@ module Mongrel
 
             if worker_list.length >= @num_processors
               STDERR.puts "Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection."
-              client.close rescue Object
+              client.close rescue nil
               reap_dead_workers("max processors")
             else
               thread = Thread.new(client) {|c| process_client(c) }
@@ -755,14 +755,14 @@ module Mongrel
               sleep @timeout/100 if @timeout > 0
             end
           rescue StopServer
-            @socket.close rescue Object
+            @socket.close rescue nil
             break
           rescue Errno::EMFILE
             reap_dead_workers("too many open files")
             sleep 0.5
           rescue Errno::ECONNABORTED
             # client closed the socket even before accept
-            client.close rescue Object
+            client.close rescue nil
           rescue Object => exc
             STDERR.puts "!!!!!! UNHANDLED EXCEPTION! #{exc}.  TELL ZED HE'S A MORON."
             STDERR.puts $!.backtrace.join("\n") if $mongrel_debug_client