42: def process(request, response)
43: return if response.socket.closed?
44:
45: path_info = request.params[Mongrel::Const::PATH_INFO]
46: page_cached = request.params[Mongrel::Const::PATH_INFO] + ".html"
47:
48: if @files.can_serve(path_info)
49:
50: @files.process(request,response)
51: elsif @files.can_serve(page_cached)
52:
53: request.params[Mongrel::Const::PATH_INFO] = page_cached
54: @files.process(request,response)
55: else
56: begin
57: cgi = Mongrel::CGIWrapper.new(request, response)
58: cgi.handler = self
59:
60: @guard.synchronize do
61:
62: Dispatcher.dispatch(cgi, ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
63: end
64:
65:
66: cgi.out {""}
67: rescue Errno::EPIPE
68:
69: rescue Object => rails_error
70: STDERR.puts "Error calling Dispatcher.dispatch #{rails_error.inspect}"
71: STDERR.puts rails_error.backtrace.join("\n")
72: end
73: end
74: end