about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-11-25 02:00:36 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-11-25 02:00:36 +0000
commitace16f96887c0ee3405c8b2e0d06660c9ab5e7f3 (patch)
tree77dc823133b90dd41c070e011b12460b3cee0de3 /lib
parent31cb7cfaf0cb441eca971f42488db5679d80e0a5 (diff)
downloadunicorn-ace16f96887c0ee3405c8b2e0d06660c9ab5e7f3.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@410 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib')
-rw-r--r--lib/mongrel/camping.rb21
1 files changed, 5 insertions, 16 deletions
diff --git a/lib/mongrel/camping.rb b/lib/mongrel/camping.rb
index ed4d12f..171dbf6 100644
--- a/lib/mongrel/camping.rb
+++ b/lib/mongrel/camping.rb
@@ -6,7 +6,6 @@
 
 require 'mongrel'
 
-
 module Mongrel
   # Support for the Camping micro framework at http://camping.rubyforge.org
   # This implements the unusually long Postamble that Camping usually
@@ -85,23 +84,13 @@ module Mongrel
           response.send_header
           response.write(body)
         end
+      rescue Errno::EPIPE
+        # ignored
+      rescue Object => camping_error
+        STDERR.puts "Error calling #{@klass}.run #{camping_error.inspect}"
+        STDERR.puts camping_error.backtrace.join("\n")
       end
     end
 
-    # This is a convenience method that wires up a CampingHandler
-    # for your application on a given port and uri.  It's pretty
-    # much all you need for a camping application to work right.
-    #
-    # It returns the Mongrel::HttpServer which you should either
-    # join or somehow manage.  The thread is running when
-    # returned.
-
-    def Camping.start(server, port, uri, klass)
-      h = Mongrel::HttpServer.new(server, port)
-      h.register(uri, CampingHandler.new(klass))
-      h.register("/favicon.ico", Mongrel::Error404Handler.new(""))
-      h.run
-      return h
-    end
   end
 end