# File lib/mongrel/rails.rb, line 63
      def process(request, response)
        return if response.socket.closed?

        path_info = request.params[Mongrel::Const::PATH_INFO]
        page_cached = path_info + ".html"
        get_or_head = @@file_only_methods.include? request.params[Mongrel::Const::REQUEST_METHOD]

        if get_or_head and @files.can_serve(path_info)
          # File exists as-is so serve it up
          @files.process(request,response)
        elsif get_or_head and @files.can_serve(page_cached)
          # possible cached page, serve it up      
          request.params[Mongrel::Const::PATH_INFO] = page_cached
          @files.process(request,response)
        else
          begin
            cgi = Mongrel::CGIWrapper.new(request, response)
            cgi.handler = self

            # ultra dangerous, but people are asking to kill themselves.  here's the Katana
            @guard.lock unless ActionController::Base.allow_concurrency

            Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)

            # This finalizes the output using the proper HttpResponse way
            cgi.out {""}
          rescue Errno::EPIPE
            # ignored
          rescue Object => rails_error
            STDERR.puts "Error calling Dispatcher.dispatch #{rails_error.inspect}"
            STDERR.puts rails_error.backtrace.join("\n")
          ensure
            @guard.unlock unless ActionController::Base.allow_concurrency
          end
        end
      end