From 2316e7dfb16518d4d0d92165bcd53b262080fc37 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 7 Feb 2009 00:25:07 -0600 Subject: Fix FCGI handler with lighttpd [#1854 state:resolved] --- railties/lib/fcgi_handler.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/railties/lib/fcgi_handler.rb b/railties/lib/fcgi_handler.rb index 1256ef2286..9e508cbcc2 100644 --- a/railties/lib/fcgi_handler.rb +++ b/railties/lib/fcgi_handler.rb @@ -38,6 +38,8 @@ class RailsFCGIHandler # Safely install signal handlers. install_signal_handlers + @app = Dispatcher.new + # Start error timestamp at 11 seconds ago. @last_error_on = Time.now - 11 end @@ -72,8 +74,8 @@ class RailsFCGIHandler cgi = nil catch :exit do - provider.each_cgi do |cgi| - process_request(cgi) + provider.each do |request| + process_request(request) case when_ready when :reload @@ -92,13 +94,13 @@ class RailsFCGIHandler close_connection(cgi) end - def process_request(cgi) + def process_request(request) @processing, @when_ready = true, nil gc_countdown with_signal_handler 'USR1' do begin - ::Rack::Handler::FastCGI.serve(cgi, Dispatcher.new) + ::Rack::Handler::FastCGI.serve(request, @app) rescue SignalException, SystemExit raise rescue Exception => error -- cgit v1.2.3