aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-02-07 00:25:07 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-07 00:25:07 -0600
commit2316e7dfb16518d4d0d92165bcd53b262080fc37 (patch)
treec6827d85da5798dade7944bde54e87bb45983db3
parent2277fbedbea930fb8ce38ab7eb133de6fcc4a2d6 (diff)
downloadrails-2316e7dfb16518d4d0d92165bcd53b262080fc37.tar.gz
rails-2316e7dfb16518d4d0d92165bcd53b262080fc37.tar.bz2
rails-2316e7dfb16518d4d0d92165bcd53b262080fc37.zip
Fix FCGI handler with lighttpd [#1854 state:resolved]
-rw-r--r--railties/lib/fcgi_handler.rb10
1 files 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