# File lib/mongrel/rails.rb, line 63
63:       def process(request, response)
64:         return if response.socket.closed?
65: 
66:         path_info = request.params[Mongrel::Const::PATH_INFO]
67:         page_cached = path_info + ".html"
68:         get_or_head = @@file_only_methods.include? request.params[Mongrel::Const::REQUEST_METHOD]
69: 
70:         if get_or_head and @files.can_serve(path_info)
71:           # File exists as-is so serve it up
72:           @files.process(request,response)
73:         elsif get_or_head and @files.can_serve(page_cached)
74:           # possible cached page, serve it up      
75:           request.params[Mongrel::Const::PATH_INFO] = page_cached
76:           @files.process(request,response)
77:         else
78:           begin
79:             cgi = Mongrel::CGIWrapper.new(request, response)
80:             cgi.handler = self
81: 
82:             # ultra dangerous, but people are asking to kill themselves.  here's the Katana
83:             @guard.lock unless ActionController::Base.allow_concurrency
84: 
85:             Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
86: 
87:             # This finalizes the output using the proper HttpResponse way
88:             cgi.out {""}
89:           rescue Errno::EPIPE
90:             # ignored
91:           rescue Object => rails_error
92:             STDERR.puts "Error calling Dispatcher.dispatch #{rails_error.inspect}"
93:             STDERR.puts rails_error.backtrace.join("\n")
94:           ensure
95:             @guard.unlock unless ActionController::Base.allow_concurrency
96:           end
97:         end
98:       end