1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Reverted zimbatm patch from r4378 since it doesn't work.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@417 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
zedshaw 2006-11-25 04:58:29 +00:00
parent b96bf4aeeb
commit d15b43d5c4

View file

@ -6,6 +6,7 @@
require 'mongrel' require 'mongrel'
module Mongrel module Mongrel
# Support for the Camping micro framework at http://camping.rubyforge.org # Support for the Camping micro framework at http://camping.rubyforge.org
# This implements the unusually long Postamble that Camping usually # This implements the unusually long Postamble that Camping usually
@ -84,13 +85,23 @@ module Mongrel
response.send_header response.send_header
response.write(body) response.write(body)
end 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
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
end end