about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-28 15:39:53 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-03-28 15:39:53 +0000
commit836a545e653874d9dbf83be2e2d1a9fb04f053c9 (patch)
treecd06200d358684e434297ac9bf02d63624f1e1f4
parent61d63bb0b7111af0093c6b3492241cfd419f55c2 (diff)
downloadunicorn-836a545e653874d9dbf83be2e2d1a9fb04f053c9.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@130 19e92222-5c0b-0410-8929-a290d50e31e9
-rw-r--r--lib/mongrel.rb6
-rw-r--r--lib/mongrel/handlers.rb8
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb
index c2dfc3b..68e878a 100644
--- a/lib/mongrel.rb
+++ b/lib/mongrel.rb
@@ -420,11 +420,7 @@ module Mongrel
             data << client.readpartial(Const::CHUNK_SIZE)
           end
         end
-      rescue EOFError
-        # ignored
-      rescue Errno::ECONNRESET
-        # ignored
-      rescue Errno::EPIPE
+      rescue EOFError,Errno::ECONNRESET,Errno::EPIPE,Errno::EINVAL
         # ignored
       rescue => details
         STDERR.puts "ERROR(#{details.class}): #{details}"
diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb
index b0f77a8..1b2a7d4 100644
--- a/lib/mongrel/handlers.rb
+++ b/lib/mongrel/handlers.rb
@@ -181,9 +181,11 @@ module Mongrel
           else
             File.open(req, "rb") { |f| response.socket.write(f.read) }
           end
-        rescue Errno::EINVAL
-          # ignore these since it means the client closed off early on win32
+        rescue EOFError,Errno::ECONNRESET,Errno::EPIPE
+          # ignore these since it means the client closed off early
         end
+      else
+        response.send_body # should send nothing
       end
     end
 
@@ -210,7 +212,7 @@ module Mongrel
             response.start(403) {|head,out| out.write("Only HEAD and GET allowed.") }
           end
         rescue => details
-          STDERR.puts "Error accessing file: #{details}"
+          STDERR.puts "Error accessing file #{req}: #{details}"
           STDERR.puts details.backtrace.join("\n")
         end
       end