From b5d757376793fcad801826ec9d81dd10dcc59c95 Mon Sep 17 00:00:00 2001 From: filipe Date: Thu, 13 Sep 2007 04:43:54 +0000 Subject: Small fixes that makes absolutely no difference to the functionality or performance of Mongrel, but closes bug [#13782]. git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@587 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/mongrel.rb') 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 -- cgit v1.2.3-24-ge0c7