# File railties/lib/rails/mongrel_server/handler.rb, line 35
def process(request, response)
return if response.socket.closed?
cgi = Mongrel::CGIWrapper.new(request, response)
cgi.handler = self
# We don't want the output to be really final until we're out of the lock
cgi.default_really_final = false
ActionController::Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
# This finalizes the output using the proper HttpResponse way
cgi.out("text/html",true) {""}
rescue Errno::EPIPE
response.socket.close
rescue Object => rails_error
STDERR.puts "#{Time.now.httpdate}: Error dispatching #{rails_error.inspect}"
STDERR.puts rails_error.backtrace.join("\n")
end